Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid non-initializing wallets #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kayanski
Copy link

This PR aims at avoiding initialization errors caused by wallets.

Rationale

On a webpage that was already connected to a wallet (if __wallet_kit_connected_wallet is set in localstorage), when refreshing the page, the connection to this wallet is triggered on page startup.
However, if anything in this startup fails, wallet-kit stays in INITIALIZED mode and the loading of any other wallet won't work.

Proposed solution

If an error is thrown during wallet startup or info query on initial wallet connection, the wallet is not connected but the WalletProvider startup is not interrupted and can continue. This allows errors during first initialization (for instance if the wallet password is not indicated correctly)

Current Use case where it's needed

I implemented a local wallet for my Webapp (for easier on-boarding). Once my user is connected, if they fail to give their password (for instance if it's forgotten), the webpage won't be able to connect any wallet anymore. They are facing a blocked state due to wallet-kit not being able to initialize correctly.

@alecande11 alecande11 self-requested a review January 16, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant