🐛 Fix circular import in router

This commit is contained in:
2023-06-05 19:45:48 +02:00
parent 7928e4941f
commit d3bfb379c4
3 changed files with 10 additions and 5 deletions

View File

@ -1,10 +1,9 @@
import { ref, watch, computed } from "vue";
import router from "./router";
import { getNextAndPrevDay } from "./util";
import i18n from "./i18n";
/* Router */
export const lastRoute = ref();
export const shouldLogin = ref(false);
export const loading = ref(false);
export const loadingProgress = ref(0);
export const loadingFailed = ref(false);
@ -70,7 +69,7 @@ export async function fetchData(days, partial) {
try {
const checkResponse = await fetch(`${baseUrl}/check`);
if (checkResponse.status == 401) {
router.push("/login");
shouldLogin.value = true;
return;
} else if (checkResponse.status != 200) {
loadingFailed.value = true;