Open peterkogo opened 1 year ago
Noticed while checking out the example projects that the "Disconnect" button had no functionality. I added a very simple toggle behaviour to both examples.
// toggle connection by clicking on connect-btn const toggleButton = document.getElementById('y-connect-btn') let connected = true toggleButton.addEventListener('click', () => { if (connected) { provider.disconnect() connected = false toggleButton.innerText = 'Reconnect' } else { provider.connect() connected = true toggleButton.innerText = 'Disconnect' } })
Noticed while checking out the example projects that the "Disconnect" button had no functionality. I added a very simple toggle behaviour to both examples.