fix: ask before removing someone's access to a shared file

This commit is contained in:
Linus Rath
2026-10-15 02:51:55 +02:00
parent 275d674577
commit d4982f6932
3 changed files with 16 additions and 1 deletions
+1
View File
@@ -449,6 +449,7 @@
"share_no_matches": "Keine Treffer",
"share_no_users": "Keine anderen Benutzer gefunden",
"share_remove": "Zugriff entfernen",
"share_remove_confirm": "Zugriff entfernen?",
"share_role_custom": "Benutzerdefiniert",
"share_search_placeholder": "Nach Name oder E-Mail suchen",
"share_unavailable": "Teilen ist auf diesem Gerät nicht verfügbar",
+1
View File
@@ -462,6 +462,7 @@
"share_no_matches": "No matches",
"share_no_users": "No other users found",
"share_remove": "Remove access",
"share_remove_confirm": "Remove access?",
"share_role_custom": "Custom",
"share_search_placeholder": "Search by name or email",
"share_unavailable": "Sharing is not available on this device",
+14 -1
View File
@@ -214,8 +214,21 @@ export default function ShareSheet({ node, onClose, onChanged }: ShareSheetProps
<ActivityIndicator size="small" color={c.textMuted} />
) : (
<Pressable
onPress={() => void applyShare(principalId, null)}
// Revoking access is immediate on the server: ask first.
onPress={() => Alert.alert(
t('files.share_remove_confirm', 'Remove access?'),
undefined,
[
{ text: t('common.cancel', 'Cancel'), style: 'cancel' },
{
text: t('files.share_remove', 'Remove access'),
style: 'destructive',
onPress: () => { void applyShare(principalId, null); },
},
],
)}
hitSlop={8}
accessibilityRole="button"
accessibilityLabel={t('files.share_remove', 'Remove access')}
>
<Trash2 size={18} color={c.error} />