1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-28 09:33:27 +02:00

fix(web): "undefined" in error message when error at uploading (#5973)

This commit is contained in:
RenautMestdagh 2023-12-26 22:42:46 +01:00 committed by GitHub
parent 733fa28aa2
commit f7a78618e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,10 +127,11 @@ function handleUploadError(asset: File, respBody = '{}', extraMessage?: string)
try {
const res = JSON.parse(respBody);
const extraMsg = res ? ' ' + res?.message : '';
const messageSuffix = extraMessage !== undefined ? ` ${extraMessage}` : '';
notificationController.show({
type: NotificationType.Error,
message: `Cannot upload file ${asset.name} ${extraMsg}${extraMessage}`,
message: `Cannot upload file ${asset.name} ${extraMsg}${messageSuffix}`,
timeout: 5000,
});
} catch (e) {