Skip to content

Commit

Permalink
use globalThis instead of window
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlauer-Hax committed Oct 9, 2024
1 parent 22b9ae7 commit e18ef6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pages/shared/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ export function getYearList(): string[] {

export function saveBlob(blob: Blob, fileName: string) {
const a = document.createElement("a");
const url = window.URL.createObjectURL(blob);
const url = globalThis.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
globalThis.URL.revokeObjectURL(url);
}

export function showPreviewImage(x: Drop) {
Expand Down
2 changes: 1 addition & 1 deletion pages/user/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async function authorize() {
const url = new URL(params.redirectUri!);
url.searchParams.set("code", API.getToken());
url.searchParams.set("state", params.state!);
window.location.href = url.toString();
globalThis.location.href = url.toString();
}

API.oauth.validate(params.clientId, params.scope, params.redirectUri)
Expand Down

0 comments on commit e18ef6f

Please sign in to comment.