From b126c574c7eccf75fdf6d1f25984d894a85fa425 Mon Sep 17 00:00:00 2001 From: Filip Gutica Date: Thu, 5 Dec 2024 10:33:38 -0800 Subject: [PATCH] fix: show loading skeleton only when state pending --- .../src/composables/useMetricFetcher.ts | 2 +- .../dashboard-renderer/src/components/QueryDataProvider.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/analytics/analytics-metric-provider/src/composables/useMetricFetcher.ts b/packages/analytics/analytics-metric-provider/src/composables/useMetricFetcher.ts index 4e44c0d5cd..53593971c0 100644 --- a/packages/analytics/analytics-metric-provider/src/composables/useMetricFetcher.ts +++ b/packages/analytics/analytics-metric-provider/src/composables/useMetricFetcher.ts @@ -173,7 +173,7 @@ export default function useMetricFetcher(opts: MetricFetcherOptions): FetcherRes }) return { - isLoading: computed(() => [STATE.PENDING, STATE.VALIDATING, STATE.VALIDATING_HAS_DATA].includes(metricRequestState.value)), + isLoading: computed(() => STATE.PENDING === metricRequestState.value), hasError: computed(() => STATE.ERROR === metricRequestState.value), raw, mapped, diff --git a/packages/analytics/dashboard-renderer/src/components/QueryDataProvider.vue b/packages/analytics/dashboard-renderer/src/components/QueryDataProvider.vue index f96eafdaaf..5b6742a525 100644 --- a/packages/analytics/dashboard-renderer/src/components/QueryDataProvider.vue +++ b/packages/analytics/dashboard-renderer/src/components/QueryDataProvider.vue @@ -137,7 +137,7 @@ const { state, swrvState: STATE } = useSwrvState(v4Data, error, isValidating) const errorMessage = ref(null) const hasError = computed(() => state.value === STATE.ERROR || !!errorMessage.value) -const isLoading = computed(() => !props.queryReady || [STATE.PENDING, STATE.VALIDATING, STATE.VALIDATING_HAS_DATA].includes(state.value)) +const isLoading = computed(() => !props.queryReady || state.value === STATE.PENDING) watch(v4Data, (data) => { if (data) {