Skip to content

Commit

Permalink
Update use_discover_histogram.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal authored Oct 14, 2024
1 parent b04350b commit 6b45e1f
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,10 @@ export const useDiscoverHistogram = ({
});
}

const isSavedSearchLoading =
savedSearchHits$.getValue().fetchStatus === FetchStatus.LOADING;
const isUnifiedHistogramLoading = status === UnifiedHistogramFetchStatus.loading;
const fetchStatus = status.toString() as FetchStatus;

// Sync the totalHits$ observable with the unified histogram state unless both are set to loading
if (isSavedSearchLoading !== isUnifiedHistogramLoading) {
// Do not sync the loading state since it's already handled by the saved search
if (fetchStatus !== FetchStatus.LOADING) {
savedSearchHits$.next({
fetchStatus,
result,
Expand Down

0 comments on commit 6b45e1f

Please sign in to comment.