Skip to content

Commit ff24d5a

Browse files
committed
fix: update loader visibility logic to show on initial load or query key change
1 parent ab4c709 commit ff24d5a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

frontend/src/ts/components/common/AsyncContent.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,9 @@ export default function AsyncContent<T extends QueryMapping>(
159159
<div class={props.errorClass}>{handleError(err)}</div>
160160
);
161161

162-
// Only show loader on initial load, not on refetches
162+
// Show loader on initial load or when the query key changed (no cached data)
163163
const showLoader = (): boolean =>
164-
isLoading() &&
165-
!props.alwaysShowContent &&
166-
lastResolvedValue() === undefined;
164+
isLoading() && !props.alwaysShowContent && !allResolved(value());
167165

168166
return (
169167
<ErrorBoundary fallback={props.ignoreError ? undefined : errorText}>

0 commit comments

Comments
 (0)