Skip to content

Commit 0217225

Browse files
committed
Only display main spinner on first load
1 parent 4980fc6 commit 0217225

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Frontend/src/components/audit/AuditList.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ function navigateToMessage(message: Message) {
8888
});
8989
}
9090
91-
let firstLoad = true;
91+
const firstLoad = ref(true);
9292
9393
onBeforeMount(() => {
9494
setQuery();
9595
9696
//without setTimeout, this happens before the store is properly initialised, and therefore the query route values aren't applied to the refresh
97-
//TODO: is there a better way to achieve this?
98-
setTimeout(async () => await Promise.all([dataRetriever.executeAndResetTimer(), store.loadEndpoints()]), 0);
99-
100-
firstLoad = false;
97+
setTimeout(async () => {
98+
await Promise.all([dataRetriever.executeAndResetTimer(), store.loadEndpoints()]);
99+
firstLoad.value = false;
100+
}, 0);
101101
});
102102
103103
watch(
@@ -110,7 +110,7 @@ watch(
110110
);
111111
112112
const watchHandle = watch([() => route.query, itemsPerPage, sortBy, messageFilterString, selectedEndpointName, dateRange], async () => {
113-
if (firstLoad) {
113+
if (firstLoad.value) {
114114
return;
115115
}
116116
@@ -165,7 +165,7 @@ watch(autoRefreshValue, (newValue) => dataRetriever.updateTimeout(newValue));
165165
</div>
166166
</div>
167167
<div class="row results-table">
168-
<LoadingSpinner v-if="isLoading" />
168+
<LoadingSpinner v-if="firstLoad" />
169169
<template v-for="message in messages" :key="message.id">
170170
<div class="item" @click="navigateToMessage(message)">
171171
<div class="status">

0 commit comments

Comments
 (0)