Skip to content

Commit

Permalink
fix: add absolute path for loading wasm files (#1002)
Browse files Browse the repository at this point in the history
Co-authored-by: Mario <[email protected]>
  • Loading branch information
brancoder and msarcev authored Jan 23, 2024
1 parent 4547930 commit c7af50a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/src/app/components/identity/DIDResolver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ export default IdentityStardustResolver;

async function constructVerifiedDomains(resolvedDID: IDIDResolverResponse): Promise<Map<string, Promise<void>>> {
const newVerifiedDomains = new Map<string, Promise<void>>();

await ServiceFactory.get<IdentityService>("identity").initLibrary();
const origin = window?.location?.origin ?? "";
await ServiceFactory.get<IdentityService>("identity").initLibrary(origin + "/wasm/identity_wasm_bg.wasm");

const didDocument = identity.IotaDocument.fromJSON(resolvedDID.document);
// Get the Linked Domain Services from the DID Document.
Expand Down
2 changes: 1 addition & 1 deletion client/src/helpers/hooks/useResolvedDID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function useResolvedDID(network: string, bech32Hrp: string, addressHex: s
setidentityResponse(response);
}
})
.then(() => identityService.initLibrary())
.then(() => identityService.initLibrary(window?.location?.origin ?? "" + "/wasm/identity_wasm_bg.wasm"))
.finally(() => {
setIsLoading(false);
});
Expand Down
3 changes: 2 additions & 1 deletion client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const apiEndpoint = (window as any).env.API_ENDPOINT;
initialiseServices()
.then(async () => {
// load the wasm
await initStardustSdk("/wasm/iota_sdk_stardust_wasm_bg.wasm");
const origin = window?.location?.origin ?? "";
await initStardustSdk(origin + "/wasm/iota_sdk_stardust_wasm_bg.wasm");

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const container = document.querySelector("#root")!;
Expand Down

0 comments on commit c7af50a

Please sign in to comment.