Skip to content

Commit

Permalink
fix type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosette committed Sep 19, 2024
1 parent 3803fbe commit 2f4387e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ declare interface Window {
};
};
}

interface Window {
webkitAudioContext: typeof AudioContext;
_SW_ENABLED?: boolean;
}
2 changes: 1 addition & 1 deletion app/utils/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function base64Image2Blob(base64Data: string, contentType: string) {
}

export function uploadImage(file: Blob): Promise<string> {
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);
}
Expand Down

0 comments on commit 2f4387e

Please sign in to comment.