Skip to content

Commit

Permalink
Wrap app in loadingIndicator component
Browse files Browse the repository at this point in the history
  • Loading branch information
dullage committed Sep 12, 2024
1 parent 87d6e8a commit ed8eb67
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div
<LoadingIndicator
ref="loadingIndicator"
class="container mx-auto flex h-screen flex-col px-2 py-4 print:max-w-full"
>
<PrimeToast />
Expand All @@ -12,7 +13,7 @@
@toggleSearchModal="toggleSearchModal"
/>
<RouterView />
</div>
</LoadingIndicator>
</template>

<script setup>
Expand All @@ -28,9 +29,11 @@ import { loadTheme } from "./helpers.js";
import NavBar from "./partials/NavBar.vue";
import SearchModal from "./partials/SearchModal.vue";
import { loadStoredToken } from "./tokenStorage.js";
import LoadingIndicator from "./components/LoadingIndicator.vue";
const globalStore = useGlobalStore();
const isSearchModalVisible = ref(false);
const loadingIndicator = ref();
const navBar = ref();
const route = useRoute();
const toast = useToast();
Expand All @@ -47,9 +50,11 @@ getConfig()
.then((data) => {
globalStore.authType = data.authType;
globalStore.hideRecentlyModified = data.hideRecentlyModified;
loadingIndicator.value.setLoaded();
})
.catch((error) => {
apiErrorHandler(error, toast);
loadingIndicator.value.setFailed();
});
loadStoredToken();
Expand Down

0 comments on commit ed8eb67

Please sign in to comment.