diff options
| author | Launchpad <67402215+rdp-studio@users.noreply.github.com> | 2023-03-10 01:22:47 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-10 02:22:47 +0900 |
| commit | caf646fcb0acb723170a78b01c66f28bd335cbee (patch) | |
| tree | e7ec2aa9b439ff1a73d8774e75985aaec96b018a | |
| parent | ドライブのファイルを消すときの文章を「ノートは消え... (diff) | |
| download | sharkey-caf646fcb0acb723170a78b01c66f28bd335cbee.tar.gz sharkey-caf646fcb0acb723170a78b01c66f28bd335cbee.tar.bz2 sharkey-caf646fcb0acb723170a78b01c66f28bd335cbee.zip | |
fix(client): Solve the problem of not automatically jumping to /admin/overview when accessing the /admin page for the second time (#10264)
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
| -rw-r--r-- | packages/frontend/src/pages/admin/index.vue | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/frontend/src/pages/admin/index.vue b/packages/frontend/src/pages/admin/index.vue index b054999303..5ebbe7e97b 100644 --- a/packages/frontend/src/pages/admin/index.vue +++ b/packages/frontend/src/pages/admin/index.vue @@ -23,7 +23,7 @@ </template> <script lang="ts" setup> -import { onMounted, onUnmounted, provide, watch } from 'vue'; +import { onActivated, onMounted, onUnmounted, provide, watch } from 'vue'; import { i18n } from '@/i18n'; import MkSuperMenu from '@/components/MkSuperMenu.vue'; import MkInfo from '@/components/MkInfo.vue'; @@ -204,6 +204,13 @@ onMounted(() => { } }); +onActivated(() => { + narrow = el.offsetWidth < NARROW_THRESHOLD; + if (currentPage?.route.name == null && !narrow) { + router.push('/admin/overview'); + } +}); + onUnmounted(() => { ro.disconnect(); }); |