Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"refreshAuth": "Refresh login",
"totpToken": "TOTP Token (if needed)",
"cancel": "Cancel",
"okay": "Okay",
"rename": "Rename",
"replace": "Replace",
"continue_": "Continue",
Expand Down
34 changes: 26 additions & 8 deletions lib/src/widgets/tags/tag_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,32 @@ class _TagEditorState extends State<TagEditor> {
padding: const EdgeInsets.only(right: 8),
child: FilledButton(
onPressed: () async {
final tag = await ac.setTag(
Tag(
id: widget.tag.id,
tag: _tagController.text,
backgroundColor: _backgroundColor,
textColor: _textColor,
),
);
Tag tag;
try {
tag = await ac.setTag(
Tag(
id: widget.tag.id,
tag: _tagController.text,
backgroundColor: _backgroundColor,
textColor: _textColor,
),
);
} catch (err) {
if (!context.mounted) return;
await showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(l(context).tags_exist),
actions: [
OutlinedButton(
onPressed: () => Navigator.pop(context),
child: Text(l(context).okay),
),
],
),
);
return;
}
widget.onUpdate(tag);
if (!context.mounted) return;
Navigator.pop(context);
Expand Down