🚸 ♻️ Refactor store and improve UX
- 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
This commit is contained in:
@ -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}`"
|
||||
>
|
||||
<TitleBar />
|
||||
<LoadingElement :active="loading" :progress="loadingProgress" />
|
||||
<LoadingElement
|
||||
:active="loading"
|
||||
:progress="loadingProgress"
|
||||
:error="loadingFailed"
|
||||
/>
|
||||
<div class="center">
|
||||
<main>
|
||||
<DateSelector v-show="isDataView" />
|
||||
|
Reference in New Issue
Block a user