Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Oct 14, 2024
1 parent 3f08047 commit ce1ab00
Showing 1 changed file with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,6 @@ export const useDiscoverHistogram = ({
}

const fetchStatus = status.toString() as FetchStatus;
if (
fetchStatus === FetchStatus.COMPLETE &&
savedSearchHits$.getValue().fetchStatus === FetchStatus.COMPLETE &&
result !== savedSearchHits$.getValue().result
) {
// this is a workaround to make sure the new total hits value is displayed
// a different value without a loading state in between would lead to be ignored by useDataState
addLog(
'[UnifiedHistogram] send loading to totalHits$ to make sure the new value is displayed',
{ status, result }
);
savedSearchHits$.next({
fetchStatus: FetchStatus.LOADING,
});
}

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

0 comments on commit ce1ab00

Please sign in to comment.