Skip to content

Commit

Permalink
fix: example for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
isordo committed Dec 5, 2023
1 parent cb8d10d commit 37256a9
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions examples/dapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@

beacon.setLogger(x)

// WC no matching key/topic errors override
window.addEventListener('unhandledrejection', function (e) {
x.error('Error occurred: ' + e.reason.message)
})

// Initiate DAppClient
const client = beacon.getDAppClientInstance({
name: 'Example DApp', // Name of the DApp,
Expand All @@ -191,24 +196,23 @@
projectId: '97f804b46f0db632c52af0556586a5f3',
relayUrl: 'wss://relay.walletconnect.com'
},
// matrixNodes: {
// [beacon.Regions.EUROPE_WEST]: [
// 'beacon-node-1.diamond.papers.tech',
// 'beacon-node-1.sky.papers.tech',
// 'beacon-node-2.sky.papers.tech',
// 'beacon-node-1.hope.papers.tech',
// 'beacon-node-1.hope-2.papers.tech',
// 'beacon-node-1.hope-3.papers.tech',
// 'beacon-node-1.hope-4.papers.tech',
// 'beacon-node-1.hope-5.papers.tech'
// ],
// [beacon.Regions.NORTH_AMERICA_EAST]: []
// },
preferredNetwork: beacon.NetworkType.GHOSTNET,
featuredWallets: ['airgap', 'metamask']
// network: {
// type: beacon.NetworkType.GHOSTNET
// }
matrixNodes: {
[beacon.Regions.EUROPE_WEST]: [
'beacon-node-1.diamond.papers.tech',
'beacon-node-1.sky.papers.tech',
'beacon-node-2.sky.papers.tech',
'beacon-node-1.hope.papers.tech',
'beacon-node-1.hope-2.papers.tech',
'beacon-node-1.hope-3.papers.tech',
'beacon-node-1.hope-4.papers.tech',
'beacon-node-1.hope-5.papers.tech'
],
[beacon.Regions.NORTH_AMERICA_EAST]: []
},
featuredWallets: ['kukai', 'metamask', 'airgap'],
network: {
type: beacon.NetworkType.GHOSTNET
}
// matrixNodes: ['test.papers.tech', 'test2.papers.tech', 'matrix.papers.tech']
// matrixNodes: ['beacon-node-0.papers.tech:8448']
// matrixNodes: ['matrix.papers.tech']
Expand Down Expand Up @@ -410,6 +414,13 @@

// Add event listener to the button
document.getElementById('reset').addEventListener('click', () => {
if (document.getElementById('reset').attributes.getNamedItem('disabled') === 'true') {
console.log('UI IS LOCKED')
return
}
document.getElementById('reset').innerText = 'Cleaning up and refreshing...'
document.getElementById('reset').setAttribute('disabled', 'true')

client.destroy().then(() => {
window.location.reload()
})
Expand Down

0 comments on commit 37256a9

Please sign in to comment.