Skip to content

Commit 21b48b3

Browse files
committed
StopSearch: Show cached result on page navigation
Technically also shows any cached result immediately, such as making a search with filter set 1, followed by another search with set 2, then doing the search with filter set 1 again should display the results immediately and updates the results on the background.
1 parent 06c4271 commit 21b48b3

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ui/src/components/stop-registry/search/by-line/StopsByLineSearchResults.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const StopsByLineSearchResults: FC<StopSearchResultsProps> = ({
2929
<LoadingWrapper
3030
className="flex justify-center"
3131
loadingText={t('search.searching')}
32-
loading={loading}
32+
loading={lines.length === 0 ? loading : false}
3333
testId={testIds.loadingSearchResults}
3434
>
3535
{groupByLine ? (

ui/src/components/stop-registry/search/by-stop/StopSearchByStopResults.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const StopSearchByStopResults: FC<StopSearchResultsProps> = ({
3131
<LoadingWrapper
3232
className="flex justify-center"
3333
loadingText={t('search.searching')}
34-
loading={loading}
34+
loading={resultCount === 0 ? loading : false}
3535
testId={testIds.loadingSearchResults}
3636
>
3737
<CountAndSortingRow

ui/src/components/stop-registry/search/for-stop-areas/StopAreaSearchResults.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const StopAreaSearchResults: FC<StopSearchResultsProps> = ({
3232
<LoadingWrapper
3333
className="flex justify-center"
3434
loadingText={t('search.searching')}
35-
loading={loading}
35+
loading={stopPlaces.length === 0 ? loading : false}
3636
testId={testIds.loadingSearchResults}
3737
>
3838
{groupByArea ? (

ui/src/components/stop-registry/search/for-terminals/TerminalSearchResults.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const TerminalSearchResults: FC<StopSearchResultsProps> = ({
3232
<LoadingWrapper
3333
className="flex justify-center"
3434
loadingText={t('search.searching')}
35-
loading={loading}
35+
loading={stopPlaces.length === 0 ? loading : false}
3636
testId={testIds.loadingSearchResults}
3737
>
3838
{groupByTerminal ? (

0 commit comments

Comments
 (0)