mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-04 16:06:41 +00:00
fix: ask before deleting a tag
This commit is contained in:
@@ -868,6 +868,7 @@
|
|||||||
"text_signature": "Klartext-Signatur"
|
"text_signature": "Klartext-Signatur"
|
||||||
},
|
},
|
||||||
"keywords": {
|
"keywords": {
|
||||||
|
"delete_confirm_title": "Tag „{label}“ löschen?",
|
||||||
"description_mobile": "Farbige Labels zum Organisieren Ihrer E-Mails.",
|
"description_mobile": "Farbige Labels zum Organisieren Ihrer E-Mails.",
|
||||||
"discover": {
|
"discover": {
|
||||||
"add_all": "Alle hinzufügen",
|
"add_all": "Alle hinzufügen",
|
||||||
|
|||||||
@@ -887,6 +887,7 @@
|
|||||||
"text_signature": "Plain-text signature"
|
"text_signature": "Plain-text signature"
|
||||||
},
|
},
|
||||||
"keywords": {
|
"keywords": {
|
||||||
|
"delete_confirm_title": "Delete tag \"{label}\"?",
|
||||||
"description_mobile": "Colored tags to organize your mail.",
|
"description_mobile": "Colored tags to organize your mail.",
|
||||||
"discover": {
|
"discover": {
|
||||||
"add_all": "Add all",
|
"add_all": "Add all",
|
||||||
|
|||||||
@@ -45,8 +45,17 @@ export function KeywordSettings() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteKeyword = (id: string) => {
|
// Deleting a tag takes it off every message's tag list on this device; ask
|
||||||
removeKeyword(id);
|
// 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
|
// 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")}>
|
<Pressable style={styles.iconBtn} onPress={() => setEditingId(kw.id)} accessibilityRole="button" accessibilityLabel={t('settings.keywords.edit', "Edit tag")}>
|
||||||
<Pencil size={14} color={c.mutedForeground} />
|
<Pencil size={14} color={c.mutedForeground} />
|
||||||
</Pressable>
|
</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} />
|
<Trash2 size={14} color={c.mutedForeground} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user