From 6e0b3e378a715824433383207d9f728fcf4d78ca Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Thu, 30 Nov 2023 09:50:49 +0700 Subject: [PATCH] fix: type error --- Services/client/src/stores/file-info-data.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Services/client/src/stores/file-info-data.ts b/Services/client/src/stores/file-info-data.ts index 0395b98..1b7ec41 100644 --- a/Services/client/src/stores/file-info-data.ts +++ b/Services/client/src/stores/file-info-data.ts @@ -127,12 +127,10 @@ export const useFileInfoStore = defineStore('info', () => { } function getType(mimeType: string | undefined): string { - if (mimeType === undefined) { - return 'unknown type' - } - if (mimeFileMapping.hasOwnProperty(mimeType)) { + if (!!mimeType && mimeFileMapping.hasOwnProperty(mimeType)) { return mimeFileMapping[mimeType].type } + return 'unknown type' } function getFormatDate(dateTime: string | undefined): string {