Skip to content

Commit

Permalink
use reactive instead of router (#897)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Polyakov authored Dec 26, 2022
1 parent 404d4f2 commit 5a80060
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/App/Menu/AppMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ import {
Components,
} from '@/consts';
import router, { lazyComponent } from '@/router';
import { lazyComponent } from '@/router';
import { getter, state } from '@/store/decorators';
@Component({
Expand Down Expand Up @@ -131,22 +131,23 @@ export default class AppMenu extends Mixins(TranslationMixin) {
}
get currentPath(): string {
if (PoolChildPages.includes(router.currentRoute.name as PageNames)) {
const currentName = this.$route.name as any;
if (PoolChildPages.includes(currentName)) {
return PageNames.Pool;
}
if (BridgeChildPages.includes(router.currentRoute.name as PageNames)) {
if (BridgeChildPages.includes(currentName)) {
return PageNames.Bridge;
}
if (RewardsChildPages.includes(router.currentRoute.name as PageNames)) {
if (RewardsChildPages.includes(currentName)) {
return PageNames.Rewards;
}
if (StakingChildPages.includes(router.currentRoute.name as any)) {
if (StakingChildPages.includes(currentName)) {
return PageNames.StakingContainer;
}
if (ExploreChildPages.includes(router.currentRoute.name as PageNames)) {
if (ExploreChildPages.includes(currentName)) {
return PageNames.ExploreContainer;
}
return router.currentRoute.name as string;
return currentName as string;
}
openSoraDownloadDialog(): void {
Expand Down

0 comments on commit 5a80060

Please sign in to comment.