diff --git a/app/global.d.ts b/app/global.d.ts index 8ee636bcd3c..6c2f5c74163 100644 --- a/app/global.d.ts +++ b/app/global.d.ts @@ -34,3 +34,8 @@ declare interface Window { }; }; } + +interface Window { + webkitAudioContext: typeof AudioContext; + _SW_ENABLED?: boolean; +} diff --git a/app/utils/chat.ts b/app/utils/chat.ts index 2c165286719..7d25a5b738f 100644 --- a/app/utils/chat.ts +++ b/app/utils/chat.ts @@ -123,7 +123,7 @@ export function base64Image2Blob(base64Data: string, contentType: string) { } export function uploadImage(file: Blob): Promise { - if (!(window as any)._SW_ENABLED) { + if (!(window as Window & {_SW_ENABLED?: boolean})._SW_ENABLED) { // if serviceWorker register error, using compressImage return compressImage(file, 256 * 1024); }