Skip to content

Commit

Permalink
feat(front/wc): launch app to sign
Browse files Browse the repository at this point in the history
  • Loading branch information
1Mateus committed Jan 25, 2024
1 parent 7da7a9c commit d4ac3c9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions front/chains/kadena/adapters/wallet-connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ const metadata = {
disabled: false
}

function isMobileSafari() {
return navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/)
}

function LaunchApp(){
window.open("KoallaWallet://TheElementThatIWantToSend","_self");
};

export const provider = defineStore({
id: 'provider:kadena:wallet-connect',

Expand Down Expand Up @@ -268,15 +276,19 @@ export const provider = defineStore({
throw new Error('No selected account to send from')
}

callbackProgress('Await sign')

const signWithWalletConnect =
createWalletConnectQuicksign(
this.client as any,
this.session,
this.account.walletConnectChainId
)

callbackProgress('Await sign')

if (isMobileSafari()) {
LaunchApp()
}

const signedCmd = await signWithWalletConnect(
transaction
)
Expand Down

0 comments on commit d4ac3c9

Please sign in to comment.