diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-27 09:46:31 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-08-27 09:46:31 +0900 |
| commit | 2e0a34300a69805fc1c34b1212afad97caa75902 (patch) | |
| tree | d30500e07bf4e4ba087dd0345885f4c59fed5943 /packages/frontend/src/components/global/RouterView.vue | |
| parent | Update CHANGELOG.md (diff) | |
| download | misskey-2e0a34300a69805fc1c34b1212afad97caa75902.tar.gz misskey-2e0a34300a69805fc1c34b1212afad97caa75902.tar.bz2 misskey-2e0a34300a69805fc1c34b1212afad97caa75902.zip | |
refactor
Diffstat (limited to 'packages/frontend/src/components/global/RouterView.vue')
| -rw-r--r-- | packages/frontend/src/components/global/RouterView.vue | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/frontend/src/components/global/RouterView.vue b/packages/frontend/src/components/global/RouterView.vue index 27f7b18559..3a508eaca0 100644 --- a/packages/frontend/src/components/global/RouterView.vue +++ b/packages/frontend/src/components/global/RouterView.vue @@ -30,19 +30,21 @@ const props = defineProps<{ router?: Router; }>(); -const router = props.router ?? inject(DI.router); +const _router = props.router ?? inject(DI.router); -if (router == null) { +if (_router == null) { throw new Error('no router provided'); } +const router = _router; + const viewId = randomId(); provide(DI.viewId, viewId); const currentDepth = inject(DI.routerCurrentDepth, 0); provide(DI.routerCurrentDepth, currentDepth + 1); -const current = router.current!; +const current = router.current; const currentPageComponent = shallowRef('component' in current.route ? current.route.component : MkLoadingPage); const currentPageProps = ref(current.props); let currentRoutePath = current.route.path; |