Skip to content

Commit

Permalink
fix: launches wallet popup when user returns to swap view from explore
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodressel authored and mmpetarpeshev committed Jun 25, 2024
1 parent 00f7821 commit 6450027
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
data() {
return {
backendSanityCheckTimeoutId: null,
walletExploreDelayed: false,
};
},
computed: {
Expand All @@ -51,6 +52,12 @@ export default {
await this.checkBackendStatus();
}
},
$route(to) {
if (!to.path.includes('/explore') && this.walletExploreDelayed) {
this.walletExploreDelayed = false;
this.$store.dispatch('connectWallet', { info: this.wallet });
}
},
},
async mounted() {
if (this.$store.state.lang) this.$i18n.locale = this.$store.state.lang;
Expand Down Expand Up @@ -98,8 +105,12 @@ export default {
delete query.address;
delete query.networkId;
this.$router.replace({ query });
} else if (this.wallet && this.address && !this.$route.fullPath.includes('/explore')) {
await this.$store.dispatch('connectWallet', { info: this.wallet });
} else if (this.wallet && this.address) {
if (this.$route.fullPath.includes('/explore')) {
this.walletExploreDelayed = true;
} else {
await this.$store.dispatch('connectWallet', { info: this.wallet });
}
}
if (
this.$isMobile &&
Expand Down

0 comments on commit 6450027

Please sign in to comment.