Skip to content

Commit

Permalink
fix Kibisis init in vue app #203 (#225)
Browse files Browse the repository at this point in the history
* fix Kibisis init in vue app #203

i faced the same issue as in #203 the issue is that the import in vuejs has the default, so fixed it the same way as it is done in defly f.e.

* Update kibisis.ts

* prettier fix
  • Loading branch information
scholtz authored Sep 13, 2024
1 parent 24b5476 commit 470171f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/use-wallet/src/wallets/kibisis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,20 @@ export class KibisisWallet extends BaseWallet {
`[${KibisisWallet.name}]#${_functionName}: initializing @agoralabs-sh/avm-web-provider...`
)

this.avmWebProviderSDK = await import('@agoralabs-sh/avm-web-provider')
const module = await import('@agoralabs-sh/avm-web-provider')
this.avmWebProviderSDK = module.default ? module.default : module

if (!this.avmWebProviderSDK) {
throw new Error(
'failed to initialize, the @agoralabs-sh/avm-web-provider sdk was not provided'
)
}

if (!this.avmWebProviderSDK.AVMWebClient) {
throw new Error(
'failed to initialize, the @agoralabs-sh/avm-web-provider sdk was not provided. AVMWebClient missing'
)
}
}

return this.avmWebProviderSDK
Expand Down

0 comments on commit 470171f

Please sign in to comment.