summaryrefslogtreecommitdiff
path: root/packages/client/src/menu.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/client/src/menu.ts')
-rw-r--r--packages/client/src/menu.ts31
1 files changed, 12 insertions, 19 deletions
diff --git a/packages/client/src/menu.ts b/packages/client/src/menu.ts
index ebc7898101..5e281f4ea1 100644
--- a/packages/client/src/menu.ts
+++ b/packages/client/src/menu.ts
@@ -1,11 +1,11 @@
import { computed, ref, reactive } from 'vue';
+import { $i } from './account';
+import { mainRouter } from '@/router';
import { search } from '@/scripts/search';
import * as os from '@/os';
import { i18n } from '@/i18n';
import { ui } from '@/config';
-import { $i } from './account';
import { unisonReload } from '@/scripts/unison-reload';
-import { router } from './router';
export const menuDef = reactive({
notifications: {
@@ -60,16 +60,16 @@ export const menuDef = reactive({
title: 'lists',
icon: 'fas fa-list-ul',
show: computed(() => $i != null),
- active: computed(() => router.currentRoute.value.path.startsWith('/timeline/list/') || router.currentRoute.value.path === '/my/lists' || router.currentRoute.value.path.startsWith('/my/lists/')),
+ active: computed(() => mainRouter.currentRoute.value.path.startsWith('/timeline/list/') || mainRouter.currentRoute.value.path === '/my/lists' || mainRouter.currentRoute.value.path.startsWith('/my/lists/')),
action: (ev) => {
const items = ref([{
- type: 'pending'
+ type: 'pending',
}]);
os.api('users/lists/list').then(lists => {
const _items = [...lists.map(list => ({
type: 'link',
text: list.name,
- to: `/timeline/list/${list.id}`
+ to: `/timeline/list/${list.id}`,
})), null, {
type: 'link',
to: '/my/lists',
@@ -91,16 +91,16 @@ export const menuDef = reactive({
title: 'antennas',
icon: 'fas fa-satellite',
show: computed(() => $i != null),
- active: computed(() => router.currentRoute.value.path.startsWith('/timeline/antenna/') || router.currentRoute.value.path === '/my/antennas' || router.currentRoute.value.path.startsWith('/my/antennas/')),
+ active: computed(() => mainRouter.currentRoute.value.path.startsWith('/timeline/antenna/') || mainRouter.currentRoute.value.path === '/my/antennas' || mainRouter.currentRoute.value.path.startsWith('/my/antennas/')),
action: (ev) => {
const items = ref([{
- type: 'pending'
+ type: 'pending',
}]);
os.api('antennas/list').then(antennas => {
const _items = [...antennas.map(antenna => ({
type: 'link',
text: antenna.name,
- to: `/timeline/antenna/${antenna.id}`
+ to: `/timeline/antenna/${antenna.id}`,
})), null, {
type: 'link',
to: '/my/antennas',
@@ -178,29 +178,22 @@ export const menuDef = reactive({
action: () => {
localStorage.setItem('ui', 'default');
unisonReload();
- }
+ },
}, {
text: i18n.ts.deck,
active: ui === 'deck',
action: () => {
localStorage.setItem('ui', 'deck');
unisonReload();
- }
+ },
}, {
text: i18n.ts.classic,
active: ui === 'classic',
action: () => {
localStorage.setItem('ui', 'classic');
unisonReload();
- }
- }, /*{
- text: i18n.ts.desktop + ' (β)',
- active: ui === 'desktop',
- action: () => {
- localStorage.setItem('ui', 'desktop');
- unisonReload();
- }
- }*/], ev.currentTarget ?? ev.target);
+ },
+ }], ev.currentTarget ?? ev.target);
},
},
});