Skip to content

Commit

Permalink
fix: Infinite load when sharing on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
zatteo committed Oct 25, 2024
1 parent f083a09 commit 43f49be
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/Multiselect/ForwardBottomSheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}

Expand Down

0 comments on commit 43f49be

Please sign in to comment.