ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
326 stars 92 forks source link

Allow tonconnect/ui to be created twice #192

Open chrisands opened 5 months ago

chrisands commented 5 months ago

Currently every time TonConnectUI initialized it tries to add to customElements and when application changes pages and initialized second time it throws an error

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry

I added condition to check if customElements exists.

Not sure, but probably should fix #171 Tested in Solidjs app.

chrisands commented 4 months ago

@thekiba rebased on main branch. Should be okay now.