From d4982f69322c9995481104d635a4b3197154a12a Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 15 Oct 2026 02:51:55 +0200 Subject: [PATCH] fix: ask before removing someone's access to a shared file --- locales/rn/de.json | 1 + locales/rn/en.json | 1 + src/components/files/ShareSheet.tsx | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/locales/rn/de.json b/locales/rn/de.json index 0f1d7dec..fb672bc5 100644 --- a/locales/rn/de.json +++ b/locales/rn/de.json @@ -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", diff --git a/locales/rn/en.json b/locales/rn/en.json index 74f1e4b1..bcddeee6 100644 --- a/locales/rn/en.json +++ b/locales/rn/en.json @@ -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", diff --git a/src/components/files/ShareSheet.tsx b/src/components/files/ShareSheet.tsx index 73e185d0..8ef24586 100644 --- a/src/components/files/ShareSheet.tsx +++ b/src/components/files/ShareSheet.tsx @@ -214,8 +214,21 @@ export default function ShareSheet({ node, onClose, onChanged }: ShareSheetProps ) : ( 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')} >