🐛 Fix circular import in router
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user