diff --git a/src/client/components/TheHomePage.vue b/src/client/components/TheHomePage.vue index 8f1d92d52f674bb575cc11c7646cc3aa1ba79aad..11f92be7eea4eefdce8cf47c9f9013a2a84febab 100644 --- a/src/client/components/TheHomePage.vue +++ b/src/client/components/TheHomePage.vue @@ -145,9 +145,10 @@ const versionDate = computed(() => { return store.antibodiesVersionDate }) * give the user a preview of what to expect after a search. */ onMounted((): void => { - store.getStatistics() - store.fetchAntibodies(store.request.fetchParams()) - store.countAntibodies(store.request.countParams()) + store.getStatistics().then(() => { + store.fetchAntibodies(store.request.fetchParams()) + store.countAntibodies(store.request.countParams()) + }) }) </script> diff --git a/src/client/store.ts b/src/client/store.ts index 402666a3012f542cfcdcb98cb0fda0976716f83e..e003d5e0cd8d2b90368418d4f85671f3c51d4809 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -170,8 +170,8 @@ export const useStore = defineStore('store', { * Get the database statistics from the server and stores it in the * corresponding variable in the store. */ - getStatistics(): void { - api.getStatistics().then(response => { + getStatistics(): Promise<void> { + return api.getStatistics().then(response => { this.statistics = Object.freeze(response.data) }).catch((err: AxiosError) => { alert(err.message)