Skip to content

Commit

Permalink
Use default wallet url if no wallet url found in params
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgahan-arikan committed Aug 8, 2023
1 parent 75051f8 commit bfeda91
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,16 @@ const defaultChainId = getDefaultChainId() || ChainId.MAINNET
// For Sequence core dev team -- app developers can ignore
// a custom wallet app url can specified in the query string
const urlParams = new URLSearchParams(window.location.search)
let walletAppURL = urlParams.get('walletAppURL')
let walletAppURL = urlParams.get('walletAppURL') ?? DEFAULT_WALLET_APP_URL

if (walletAppURL && walletAppURL.length > 0) {
// Wallet can point to a custom wallet app url
// NOTICE: this is not needed, unless testing an alpha version of the wallet
sequence.initWallet({ defaultNetwork: defaultChainId, transports: { walletAppURL } })
} else {
walletAppURL = DEFAULT_WALLET_APP_URL

// Init the sequence wallet library at the top-level of your project with
// your designed default chain id
sequence.initWallet({ defaultNetwork: defaultChainId })
sequence.initWallet({ defaultNetwork: defaultChainId, transports: { walletAppURL } })
}

// App component
Expand Down

0 comments on commit bfeda91

Please sign in to comment.