trim new tags

This commit is contained in:
Thibault Deckers 2024-11-24 00:08:26 +01:00
parent ffbf0bd8f2
commit 5b6eb44c05
2 changed files with 2 additions and 8 deletions

View file

@ -423,13 +423,6 @@ class _AvesAppState extends State<AvesApp> with WidgetsBindingObserver {
} }
} }
@override
void didHaveMemoryPressure() {
super.didHaveMemoryPressure();
debugPrint('App memory pressure');
imageCache.clear();
}
@override @override
void didChangeMetrics() => _updateCutoutInsets(); void didChangeMetrics() => _updateCutoutInsets();

View file

@ -152,7 +152,7 @@ class _TagEditorPageState extends State<TagEditorPage> {
builder: (context, value, child) { builder: (context, value, child) {
return IconButton( return IconButton(
icon: const Icon(AIcons.add), icon: const Icon(AIcons.add),
onPressed: value.text.isEmpty ? null : () => _addCustomTag(_newTagTextController.text), onPressed: value.text.trim().isEmpty ? null : () => _addCustomTag(_newTagTextController.text),
tooltip: l10n.tagEditorPageAddTagTooltip, tooltip: l10n.tagEditorPageAddTagTooltip,
); );
}, },
@ -296,6 +296,7 @@ class _TagEditorPageState extends State<TagEditorPage> {
} }
void _addCustomTag(String newTag) { void _addCustomTag(String newTag) {
newTag = newTag.trim();
if (newTag.isNotEmpty) { if (newTag.isNotEmpty) {
_addTag(TagFilter(newTag)); _addTag(TagFilter(newTag));
} }