From f7a78618e500ca9dc0dd4b547f95e8da4185c3a0 Mon Sep 17 00:00:00 2001 From: RenautMestdagh <82072978+RenautMestdagh@users.noreply.github.com> Date: Tue, 26 Dec 2023 22:42:46 +0100 Subject: [PATCH] fix(web): "undefined" in error message when error at uploading (#5973) --- web/src/lib/utils/file-uploader.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/lib/utils/file-uploader.ts b/web/src/lib/utils/file-uploader.ts index 2cf8dec652..b61437a12f 100644 --- a/web/src/lib/utils/file-uploader.ts +++ b/web/src/lib/utils/file-uploader.ts @@ -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) {