summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/global/RouterView.vue
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-08-27 09:46:31 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-08-27 09:46:31 +0900
commit2e0a34300a69805fc1c34b1212afad97caa75902 (patch)
treed30500e07bf4e4ba087dd0345885f4c59fed5943 /packages/frontend/src/components/global/RouterView.vue
parentUpdate CHANGELOG.md (diff)
downloadmisskey-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.vue8
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;