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

clear state if the network changes #178

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

futurepaul
Copy link
Contributor

No description provided.

@futurepaul
Copy link
Contributor Author

closes MutinyWallet/mutiny-web-poc#20

if (existingNetwork !== nodeManagerSettings.network) {
if (window.confirm("Changing networks will delete your node's state. This can't be undone!")) {
localStorage.clear();
window.location.reload();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to write to storage the network on confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think after localStorage.clear() it needs to write network.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this happens in the setup function

if (existingNetwork !== nodeManagerSettings.network) {
if (window.confirm("Changing networks will delete your node's state. This can't be undone!")) {
localStorage.clear();
window.location.reload();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think after localStorage.clear() it needs to write network.

@futurepaul futurepaul merged commit 74fd4c0 into master Dec 6, 2022
@benthecarman benthecarman deleted the clear-state-on-network-change branch December 6, 2022 07:54
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.

3 participants