Skip to content

Commit c90f278

Browse files
authored
Merge branch 'v2-preview' into feat-usernameAlias-doc
2 parents 5750b8f + 359bb32 commit c90f278

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

client/src/docs-ui/page/page.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,17 @@ export class DocsPage {
3535
@State() selectedFilters: Record<string, string | undefined> = {};
3636

3737
setSelectedFilters: SetSelectedFilters = (updates) => {
38+
const overrides = withFilterOverrides(updates, this.selectedFilters);
3839
this.selectedFilters = {
3940
...this.selectedFilters,
40-
...withFilterOverrides(updates, this.selectedFilters),
41+
...overrides,
4142
};
43+
for (const [filterKey, filterValue] of Object.entries(overrides)) {
44+
localStorage.setItem(
45+
getFilterKeyFromLocalStorage(filterKey),
46+
filterValue,
47+
);
48+
}
4249
};
4350

4451
/**
@@ -57,10 +64,6 @@ export class DocsPage {
5764
const {[this.filterKey]: filterValue} = queryParams;
5865
if (filterValue) {
5966
this.filterValue = filterValue;
60-
localStorage.setItem(
61-
getFilterKeyFromLocalStorage(this.filterKey),
62-
filterValue,
63-
);
6467
this.setSelectedFilters({[this.filterKey]: this.filterValue});
6568
}
6669
}

0 commit comments

Comments
 (0)