feat(mobile) duplicated asset upload handling mechanism (#853)

This commit is contained in:
Alex 2022-10-25 09:51:03 -05:00 committed by GitHub
parent f1af17bf4d
commit 6159c83fd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 836 additions and 38 deletions

View file

@ -200,12 +200,12 @@ async function fileUploader(asset: File, uploadType: UploadType) {
}
// TODO: This should have a proper type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function handleUploadError(asset: File, respBody?: any) {
const extraMsg = respBody ? ' ' + respBody.message : '';
function handleUploadError(asset: File, respBody: any, extraMessage?: string) {
const extraMsg = respBody ? ' ' + respBody?.message : '';
notificationController.show({
type: NotificationType.Error,
message: `Cannot upload file ${asset.name}!${extraMsg}`,
message: `Cannot upload file ${asset.name} ${extraMsg}${extraMessage}`,
timeout: 5000
});
}