summaryrefslogtreecommitdiff
path: root/packages/client/src/components
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2022-04-23 19:17:15 +0900
committerGitHub <noreply@github.com>2022-04-23 19:17:15 +0900
commiteac71ae1d7f7d1ee4c06c4060979b7b292c0e57e (patch)
treed97a10506033d82f0d439c6111978d346e617800 /packages/client/src/components
parentchore: fix lint command for windows (diff)
downloadmisskey-eac71ae1d7f7d1ee4c06c4060979b7b292c0e57e.tar.gz
misskey-eac71ae1d7f7d1ee4c06c4060979b7b292c0e57e.tar.bz2
misskey-eac71ae1d7f7d1ee4c06c4060979b7b292c0e57e.zip
fix: Fix settings page (#8508)
* Fix settings page * nanka iroiro * clean up * clean up * インデックスに戻ってもタイトルが残ってしまうのを修正
Diffstat (limited to 'packages/client/src/components')
-rw-r--r--packages/client/src/components/global/a.vue25
1 files changed, 5 insertions, 20 deletions
diff --git a/packages/client/src/components/global/a.vue b/packages/client/src/components/global/a.vue
index 52fef50f9b..5287d59b3e 100644
--- a/packages/client/src/components/global/a.vue
+++ b/packages/client/src/components/global/a.vue
@@ -5,14 +5,13 @@
</template>
<script lang="ts" setup>
-import { inject } from 'vue';
import * as os from '@/os';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import { router } from '@/router';
import { url } from '@/config';
import { popout as popout_ } from '@/scripts/popout';
import { i18n } from '@/i18n';
-import { defaultStore } from '@/store';
+import { MisskeyNavigator } from '@/scripts/navigate';
const props = withDefaults(defineProps<{
to: string;
@@ -23,9 +22,7 @@ const props = withDefaults(defineProps<{
behavior: null,
});
-type Navigate = (path: string, record?: boolean) => void;
-const navHook = inject<null | Navigate>('navHook', null);
-const sideViewHook = inject<null | Navigate>('sideViewHook', null);
+const mkNav = new MisskeyNavigator();
const active = $computed(() => {
if (props.activeClass == null) return false;
@@ -48,11 +45,11 @@ function onContextmenu(ev) {
action: () => {
os.pageWindow(props.to);
}
- }, sideViewHook ? {
+ }, mkNav.sideViewHook ? {
icon: 'fas fa-columns',
text: i18n.ts.openInSideView,
action: () => {
- sideViewHook(props.to);
+ if (mkNav.sideViewHook) mkNav.sideViewHook(props.to);
}
} : undefined, {
icon: 'fas fa-expand-alt',
@@ -101,18 +98,6 @@ function nav() {
}
}
- if (navHook) {
- navHook(props.to);
- } else {
- if (defaultStore.state.defaultSideView && sideViewHook && props.to !== '/') {
- return sideViewHook(props.to);
- }
-
- if (router.currentRoute.value.path === props.to) {
- window.scroll({ top: 0, behavior: 'smooth' });
- } else {
- router.push(props.to);
- }
- }
+ mkNav.push(props.to);
}
</script>