From 43f49be70903be93d34c95ebffca78bf5784e715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Fri, 25 Oct 2024 09:40:38 +0200 Subject: [PATCH] fix: Infinite load when sharing on Android --- .../Multiselect/ForwardBottomSheet.jsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Multiselect/ForwardBottomSheet.jsx b/src/components/Multiselect/ForwardBottomSheet.jsx index 1bfe31f3..740ed3c7 100644 --- a/src/components/Multiselect/ForwardBottomSheet.jsx +++ b/src/components/Multiselect/ForwardBottomSheet.jsx @@ -73,20 +73,24 @@ export const ForwardBottomSheet = ({ onClose, filesWithPage, shareByLink }) => { navigate('..', { replace: true }) } } catch (error) { - if (error.message === 'User did not share') return - if (fileIdsToRemove.length > 0) { removeFilesPermanently(client, fileIdsToRemove).catch(error => { log.error(`Error while removing files in catch: ${error}`) }) } - showAlert({ - message: t('ShareBottomSheet.attachmentResponse.error'), - severity: 'error', - variant: 'filled' - }) - onClose() + // On Android, due to a bug in the library we use, the flagship app always throws "User did not share" error + // even if user did share. So in this case we prefer to close the bottom sheet without showing an error. + if (error.message === 'User did not share') { + onClose() + } else { + showAlert({ + message: t('ShareBottomSheet.attachmentResponse.error'), + severity: 'error', + variant: 'filled' + }) + onClose() + } } }