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

Fix AppMenu active item #897

Merged
merged 2 commits into from
Dec 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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