Skip to content

Commit

Permalink
avoid the "duplicated promise" error which comes from the vue-router (
Browse files Browse the repository at this point in the history
…fix symbol#252 )
  • Loading branch information
vincent-lee90 committed Apr 22, 2020
1 parent f078610 commit 32ccb64
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/PageNavigator/PageNavigator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
$route.matched.map(({path}) => path).includes(route.path) ? 'active' : '',
!currentAccount ? 'un_click' : '',
]"
@click="!currentAccount ? '' : $router.push({name: route.name})"
@click="onPageNavigate(route)"
>
<div class="navigator-icon-container">
<img :src="route.meta.icon" class="navigator-icon">
Expand Down
5 changes: 5 additions & 0 deletions src/components/PageNavigator/PageNavigatorTs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {Component, Vue} from 'vue-property-decorator'
import {mapGetters} from 'vuex'
// internal dependencies
import {AccountModel} from '@/core/database/entities/AccountModel'
import { Route } from 'vue-router'

@Component({
computed: {
Expand All @@ -41,4 +42,8 @@ export class PageNavigatorTs extends Vue {
await this.$store.dispatch('account/LOG_OUT')
this.$router.push({name: 'accounts.login'})
}

public onPageNavigate(route: Route) {
this.currentAccount && this.$router.push({ name: route.name }).catch(()=>{/**/})
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="wallet-detail-outer-container" v-show="currentWallet">
<div v-show="currentWallet" class="wallet-detail-outer-container">
<div class="wallet-detail-inner-container">
<div class="left-container">
<div class="wallet-details-grid">
Expand Down

0 comments on commit 32ccb64

Please sign in to comment.