Skip to content

Commit

Permalink
fix: show loading skeleton only when state pending (#1835)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipgutica authored Dec 5, 2024
1 parent 1e0058f commit 77d34aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const { state, swrvState: STATE } = useSwrvState(v4Data, error, isValidating)
const errorMessage = ref<string | null>(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) {
Expand Down

0 comments on commit 77d34aa

Please sign in to comment.