Skip to content

Commit

Permalink
pages/: fix fetch on ES5
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Jan 10, 2022
1 parent 2dba124 commit 5c56567
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/async_bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ export const import2 = (url: string): Promise<unknown> => {
return define([url]) // eslint-disable-line @typescript-eslint/no-unsafe-call
}

export const fetch: (input: string, init?: Partial<Request>) => Promise<Response> = globalThis.fetch as any
export const fetch = (input: string, init?: Partial<Request>): Promise<Response> => {
const a = globalThis.fetch
return a(input as `/${string}`, init)
}

if (!Build.NDEBUG) { (window as any).updateUI = (): void => { void post_(kPgReq.reloadCSS, null) } }
//#endregion
Expand Down

0 comments on commit 5c56567

Please # to comment.