From d1910a7877abb679adeebe88514c5ad79f83414f Mon Sep 17 00:00:00 2001 From: minie4 Date: Sun, 4 Jun 2023 20:05:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Still=20try=20loading=20timetabl?= =?UTF-8?q?e=20after=20initial=20fetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the user triggers a new data fetch and there is no timetable data available, the app now tries to request the timetable again instead of just doing a partial fetch. --- src/store.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/store.js b/src/store.js index 38894ee..39f18af 100644 --- a/src/store.js +++ b/src/store.js @@ -59,6 +59,10 @@ export const classList = ref({}); const baseUrl = import.meta.env.VITE_API_ENDPOINT || "/api"; export async function fetchData(days, partial) { + if (!timetable.value.data || Object.keys(classList.value).length == 0) { + partial = false; + } + const steps = 2 * days.length + (partial ? 0 : 2); let step = 1; loadingFailed.value = false;