-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[SLO] Fix back button when clicking on overview stats #245092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
ff0c44e
4e7bff5
7f07675
47df4db
c8d37b0
59f35ad
c3e8aa4
e67967c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,9 +67,9 @@ export function useUrlSearchState(): { | |
| const sub = urlStateStorage.current | ||
| ?.change$<SearchState>(SLO_LIST_SEARCH_URL_STORAGE_KEY) | ||
| .subscribe((newSearchState) => { | ||
| if (newSearchState) { | ||
| setState(newSearchState); | ||
| } | ||
| // When URL has no search params, newSearchState will be null/undefined | ||
| // In that case, reset to DEFAULT_STATE | ||
| setState(newSearchState ?? DEFAULT_STATE); | ||
| }); | ||
|
|
||
| setState( | ||
|
|
@@ -89,7 +89,7 @@ export function useUrlSearchState(): { | |
| setState(() => updatedState); | ||
|
|
||
| urlStateStorage.current?.set(SLO_LIST_SEARCH_URL_STORAGE_KEY, updatedState, { | ||
| replace: true, | ||
| replace: false, | ||
|
||
| }); | ||
|
|
||
| // Discard search itself from session storage. Keep only view preferences | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty/cleared search state resets to DEFAULT_STATE.