✨ Add loading spinner
This commit is contained in:
@ -3,6 +3,7 @@ import { ref, watch } from "vue";
|
||||
import router from "./router";
|
||||
|
||||
export const lastRoute = ref();
|
||||
export const loading = ref(false);
|
||||
|
||||
export const substitutionFilter = ref(
|
||||
localStorage.getItem("substitutionFilter") || "all"
|
||||
@ -66,6 +67,8 @@ export const parsedTimetable = computed(() => {
|
||||
const baseUrl = import.meta.env.VITE_API_ENDPOINT || "/api";
|
||||
|
||||
export async function fetchData() {
|
||||
loading.value = true;
|
||||
|
||||
const checkResponse = await fetch(`${baseUrl}/check`);
|
||||
if (checkResponse.status != 200) router.push("/login");
|
||||
|
||||
@ -73,6 +76,8 @@ export async function fetchData() {
|
||||
fetchTimetable();
|
||||
fetchSubstitutions();
|
||||
fetchHistory();
|
||||
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
export async function fetchClassList() {
|
||||
|
Reference in New Issue
Block a user