Skip to content

Commit

Permalink
fix failed to parse url in nextjs #205
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don authored Jul 3, 2024
1 parent f70ace6 commit e7122c6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/ts/common/LibraryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ export default class LibraryUtils {
if (LibraryUtils.WASM_MODULE) return LibraryUtils.WASM_MODULE;

// load module
const fetch_ = globalThis.fetch;
globalThis.fetch = undefined; // prevent fetch in worker
let module = await require("../../../../dist/monero_wallet_keys")();
LibraryUtils.WASM_MODULE = module
globalThis.fetch = fetch_;
LibraryUtils.WASM_MODULE = module;
delete LibraryUtils.WASM_MODULE.then;
LibraryUtils.initWasmModule(LibraryUtils.WASM_MODULE);
return module;
Expand All @@ -106,8 +109,11 @@ export default class LibraryUtils {
if (LibraryUtils.WASM_MODULE && LibraryUtils.FULL_LOADED) return LibraryUtils.WASM_MODULE;

// load module
const fetch_ = globalThis.fetch;
globalThis.fetch = undefined; // prevent fetch in worker
let module = await require("../../../../dist/monero_wallet_full")();
LibraryUtils.WASM_MODULE = module
globalThis.fetch = fetch_;
LibraryUtils.WASM_MODULE = module;
delete LibraryUtils.WASM_MODULE.then;
LibraryUtils.FULL_LOADED = true;
LibraryUtils.initWasmModule(LibraryUtils.WASM_MODULE);
Expand Down

0 comments on commit e7122c6

Please sign in to comment.