Skip to content

Commit

Permalink
#6: Fixed manual link opening for WebAuth wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyjamer committed Mar 12, 2024
1 parent ca422e8 commit 9c36d34
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export class WalletPluginWebAuth extends AbstractWalletPlugin {
// Add the callback to the request
const callback = setTransactionCallback(modifiedRequest, this.buoyUrl)

const request = modifiedRequest.encode(true, false)
const request = modifiedRequest.encode(true, false, `${this.scheme}:`)

// Mobile will return true or false, desktop will return undefined
const isSameDevice = this.data.sameDevice !== false
Expand Down Expand Up @@ -442,7 +442,12 @@ export class WalletPluginWebAuth extends AbstractWalletPlugin {
}),
data: {
onClick: isSameDevice
? () => (window.location.href = sameDeviceRequest.encode())
? () =>
(window.location.href = sameDeviceRequest.encode(
true,
true,
`${this.scheme}:`
))
: signManually,
label: t('transact.label', {
default: 'Sign manually or with another device',
Expand Down Expand Up @@ -488,7 +493,7 @@ export class WalletPluginWebAuth extends AbstractWalletPlugin {
})
} else {
// If no channel is defined, fallback to the same device request and trigger immediately
window.location.href = sameDeviceRequest.encode()
window.location.href = sameDeviceRequest.encode(true, true, `${this.scheme}:`)
}

// Wait for either the callback or the prompt to resolve
Expand Down

0 comments on commit 9c36d34

Please sign in to comment.