diff --git a/src/config.js b/src/config.js index 8b7b7a4e..41c3d138 100644 --- a/src/config.js +++ b/src/config.js @@ -18,7 +18,7 @@ export const MIGRATION_ORIGIN = 'https://truckwash.io'; export const REQUEST_QUEUE_CONFIG = Object.freeze({ // Per-method concurrency limits concurrency: Object.freeze({ - GET: 5, + GET: 10, POST: 1, PATCH: 1, PUT: 1, diff --git a/src/views/dashboards/departmentDashboard/modules/daily-report/DepartmentWeather.vue b/src/views/dashboards/departmentDashboard/modules/daily-report/DepartmentWeather.vue index 2ef921e6..ecafafb3 100644 --- a/src/views/dashboards/departmentDashboard/modules/daily-report/DepartmentWeather.vue +++ b/src/views/dashboards/departmentDashboard/modules/daily-report/DepartmentWeather.vue @@ -19,6 +19,7 @@ const props = defineProps({ const state = ref([]); const latestRequestToken = ref(0); +const isLoading = ref(false); const summarizeDaily = ref(false); const statusPriority = { unknown: 0, @@ -178,10 +179,13 @@ const getWeather = async () => { latestRequestToken.value = requestToken; if (ids.length === 0 || !hasDateFrom || !hasDateTo) { + isLoading.value = false; state.value = []; return; } + isLoading.value = true; + try { const response = await ObjectsGlobal.get.objects("/departments/weather", { ids: ids.join(","), @@ -204,6 +208,10 @@ const getWeather = async () => { return; } state.value = []; + } finally { + if (requestToken === latestRequestToken.value) { + isLoading.value = false; + } } }; @@ -221,8 +229,12 @@ watch(