File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments