From d22755d8c3390dd0785ad65481cf027b755de560 Mon Sep 17 00:00:00 2001 From: minie4 Date: Sun, 1 Jan 2023 23:09:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20=E2=99=BB=EF=B8=8F=20Refactor=20?= =?UTF-8?q?store=20and=20improve=20UX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move view related functions out of the store - Restructure the store.js file - Improve error handling of `/check` - Show red loading spinner if data fetch failed - Prefetch current, next and previous day instead of only current - Refactor some other frontend file --- src/App.vue | 8 +- src/components/history-list.vue | 43 ++---- src/components/substitution-list.vue | 8 +- src/components/timetable-list.vue | 17 +- src/store.js | 223 +++++++++++++++------------ src/util.js | 8 + 6 files changed, 165 insertions(+), 142 deletions(-) diff --git a/src/App.vue b/src/App.vue index f060725..32e08c5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,7 +4,7 @@ import TitleBar from "./components/titlebar-element.vue"; import BottomNavbar from "./components/bottom-navbar.vue"; import DateSelector from "./components/date-selector.vue"; import LoadingElement from "./components/loading-element.vue"; -import { loading, loadingProgress, theme } from "./store"; +import { loading, loadingProgress, loadingFailed, theme } from "./store"; import { computed, ref } from "vue"; const autoThemes = { true: "dark", false: "light" }; @@ -31,7 +31,11 @@ const isDataView = computed(() => { :class="theme == 'auto' ? `theme-${autoTheme}` : `theme-${theme}`" > - +
diff --git a/src/components/history-list.vue b/src/components/history-list.vue index 4fc074d..b97f0d7 100644 --- a/src/components/history-list.vue +++ b/src/components/history-list.vue @@ -1,5 +1,5 @@