Skip to content

Commit

Permalink
CU-86a23ccez - Fix Svelte Wallet Connect for TurboRepo
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoDizConde committed Mar 20, 2024
1 parent d9368e3 commit fcc8612
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/wallet-connect-sdk-svelte",
"comment": "Hotfix an error during the build process using SvelteKit and TurboRepo.",
"type": "patch"
}
],
"packageName": "@cityofzion/wallet-connect-sdk-svelte"
}
16 changes: 11 additions & 5 deletions packages/wallet-connect-sdk-svelte/src/WcSdkStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,18 @@ export class WCSDKStore implements IWalletConnectStore {
}

private async setupWcClient(options: SignClientTypes.Options) {
this.sdk = await WcSdk.init(options)
const signClient = this.sdk.signClient
if (this.autoManageSession) {
this.manageSession()
try {
this.sdk = await WcSdk.init(options)
const signClient = this.sdk.signClient
if (this.autoManageSession) {
this.manageSession()
}
this.signClientWritable.set(signClient)
} catch (error) {
if ((error as string) !== 'TypeError: WcSdk.init is not a function') {
console.error(error)
}
}
this.signClientWritable.set(signClient)
}

private get SdkOrError() {
Expand Down

0 comments on commit fcc8612

Please sign in to comment.