Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Infinite load when sharing on Android #685

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading