fix: ask before deleting a tag

This commit is contained in:
Linus Rath
2026-10-15 02:51:54 +02:00
parent 0460da51e5
commit 275d674577
3 changed files with 14 additions and 3 deletions
+1
View File
@@ -868,6 +868,7 @@
"text_signature": "Klartext-Signatur"
},
"keywords": {
"delete_confirm_title": "Tag „{label}“ löschen?",
"description_mobile": "Farbige Labels zum Organisieren Ihrer E-Mails.",
"discover": {
"add_all": "Alle hinzufügen",
+1
View File
@@ -887,6 +887,7 @@
"text_signature": "Plain-text signature"
},
"keywords": {
"delete_confirm_title": "Delete tag \"{label}\"?",
"description_mobile": "Colored tags to organize your mail.",
"discover": {
"add_all": "Add all",
+12 -3
View File
@@ -45,8 +45,17 @@ export function KeywordSettings() {
}
};
const deleteKeyword = (id: string) => {
removeKeyword(id);
// Deleting a tag takes it off every message's tag list on this device; ask
// first, as the reset next to it does.
const deleteKeyword = (id: string, label: string) => {
Alert.alert(
t('settings.keywords.delete_confirm_title', 'Delete tag "{label}"?', { label }),
undefined,
[
{ text: t('common.cancel', 'Cancel'), style: 'cancel' },
{ text: t('settings.keywords.delete', 'Delete tag'), style: 'destructive', onPress: () => removeKeyword(id) },
],
);
};
// One stray tap used to wipe a carefully built tag list (webmail removed
@@ -119,7 +128,7 @@ export function KeywordSettings() {
<Pressable style={styles.iconBtn} onPress={() => setEditingId(kw.id)} accessibilityRole="button" accessibilityLabel={t('settings.keywords.edit', "Edit tag")}>
<Pencil size={14} color={c.mutedForeground} />
</Pressable>
<Pressable style={styles.iconBtn} onPress={() => deleteKeyword(kw.id)} accessibilityRole="button" accessibilityLabel={t('settings.keywords.delete', "Delete tag")}>
<Pressable style={styles.iconBtn} onPress={() => deleteKeyword(kw.id, kw.label)} accessibilityRole="button" accessibilityLabel={t('settings.keywords.delete', "Delete tag")}>
<Trash2 size={14} color={c.mutedForeground} />
</Pressable>
</View>