diff --git a/src/components/FetchData.vue b/src/components/FetchData.vue
index 3038aa88e..8dacc1163 100644
--- a/src/components/FetchData.vue
+++ b/src/components/FetchData.vue
@@ -1,6 +1,7 @@
diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue
index 00faaebc2..f1e3f5e6c 100644
--- a/src/components/NavBar.vue
+++ b/src/components/NavBar.vue
@@ -3,6 +3,7 @@ import { onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useState } from 'src/composables/useState';
import { useStateStore } from 'stores/useStateStore';
+import { useStateQuery } from 'src/composables/useStateQuery';
import { useQuasar } from 'quasar';
import PinnedModules from './PinnedModules.vue';
import UserPanel from 'components/UserPanel.vue';
@@ -12,6 +13,7 @@ import VnAvatar from './ui/VnAvatar.vue';
const { t } = useI18n();
const stateStore = useStateStore();
const quasar = useQuasar();
+const stateQuery = useStateQuery();
const state = useState();
const user = state.getUser();
const appName = 'Lilium';
@@ -50,6 +52,14 @@ const pinnedModulesRef = ref();
+
@@ -104,6 +114,9 @@ const pinnedModulesRef = ref();
.q-header {
background-color: var(--vn-section-color);
}
+.no-visible {
+ visibility: hidden;
+}
en:
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js
index 651bcefb0..49fed1a9b 100644
--- a/src/composables/useArrayData.js
+++ b/src/composables/useArrayData.js
@@ -3,8 +3,10 @@ import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
import { useArrayDataStore } from 'stores/useArrayDataStore';
import { buildFilter } from 'filters/filterPanel';
+import { useStateQuery } from 'src/composables/useStateQuery';
const arrayDataStore = useArrayDataStore();
+const stateQuery = useStateQuery();
export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
if (!key) throw new Error('ArrayData: A key is required to use this composable');
@@ -99,11 +101,18 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
params.filter = JSON.stringify(params.filter);
store.currentFilter = params;
+
store.isLoading = true;
- const response = await axios.get(store.url, {
- signal: canceller.signal,
- params,
- });
+ const hash = stateQuery.add();
+ let response;
+ try {
+ response = await axios.get(store.url, {
+ signal: canceller.signal,
+ params,
+ });
+ } finally {
+ stateQuery.remove(hash);
+ }
const { limit } = filter;
store.hasMoreData = limit && response.data.length >= limit;
diff --git a/src/composables/useStateQuery.js b/src/composables/useStateQuery.js
new file mode 100644
index 000000000..e377ad564
--- /dev/null
+++ b/src/composables/useStateQuery.js
@@ -0,0 +1,27 @@
+import { ref, computed } from 'vue';
+
+const queries = ref(new Set());
+
+export function useStateQuery() {
+ function add() {
+ const min = 100000;
+ const max = 999999;
+ const hash = String(Math.floor(Math.random() * (max - min + 1)) + min);
+ queries.value.add(hash);
+ return hash;
+ }
+
+ function isLoading() {
+ return computed(() => queries.value.size);
+ }
+
+ function remove(hash) {
+ queries.value.delete(hash);
+ }
+
+ return {
+ add,
+ isLoading,
+ remove,
+ };
+}
diff --git a/src/pages/Item/Card/ItemCard.vue b/src/pages/Item/Card/ItemCard.vue
index 1162327c1..2412f2bf9 100644
--- a/src/pages/Item/Card/ItemCard.vue
+++ b/src/pages/Item/Card/ItemCard.vue
@@ -12,7 +12,7 @@ import ItemListFilter from '../ItemListFilter.vue';
search-data-key="ItemList"
:searchbar-props="{
url: 'Items/filter',
- label: 'searchbar.labelr',
+ label: 'searchbar.label',
info: 'searchbar.info',
}"
/>