fix(router): circular dependency

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Fernando Fernández
2026-06-17 13:41:52 +02:00
parent f74c6e6122
commit d17f85be4d
2 changed files with 14 additions and 9 deletions
+13 -1
View File
@@ -22,7 +22,7 @@ import 'uno.css';
import '#/assets/styles/index.css';
/**
* - VUE PLUGINS, STORE AND DIRECTIVE -
* - Vue.js PLUGINS, STORE AND DIRECTIVE -
* The order of statements IS IMPORTANT
*/
const remote = createRemote();
@@ -55,3 +55,15 @@ await document.fonts.ready;
* MOUNTING POINT
*/
app.mount(document.body);
/**
* DEV-MODE LOGIC
*/
if (import.meta.env.DEV) {
/* eslint-disable-next-line unicorn/no-lonely-if */
if (import.meta.hot) {
const { handleHotUpdate } = await import('vue-router/auto-routes');
handleHotUpdate(router);
}
}
@@ -4,7 +4,6 @@ import {
createWebHashHistory,
createWebHistory
} from 'vue-router';
import { handleHotUpdate } from 'vue-router/auto-routes';
import { isStr } from '@jellyfin-vue/shared/validation';
import { remote } from '../remote/index.ts';
import { adminGuard } from './middlewares/admin-pages.ts';
@@ -22,9 +21,7 @@ export const router = createRouter({
/**
* TODO: Fix this, so it only scrolls to the top once suspense resolves
*/
scrollBehavior(_to, _from, savedPosition) {
return savedPosition ?? { top: 0 };
}
scrollBehavior: (_to, _from, savedPosition) => savedPosition ?? { top: 0 }
});
/**
@@ -76,7 +73,3 @@ watch([
force: true
});
}, { flush: 'sync' });
if (import.meta.hot) {
handleHotUpdate(router);
}