File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,17 @@ export class DocsPage {
35
35
@State ( ) selectedFilters : Record < string , string | undefined > = { } ;
36
36
37
37
setSelectedFilters : SetSelectedFilters = ( updates ) => {
38
+ const overrides = withFilterOverrides ( updates , this . selectedFilters ) ;
38
39
this . selectedFilters = {
39
40
...this . selectedFilters ,
40
- ...withFilterOverrides ( updates , this . selectedFilters ) ,
41
+ ...overrides ,
41
42
} ;
43
+ for ( const [ filterKey , filterValue ] of Object . entries ( overrides ) ) {
44
+ localStorage . setItem (
45
+ getFilterKeyFromLocalStorage ( filterKey ) ,
46
+ filterValue ,
47
+ ) ;
48
+ }
42
49
} ;
43
50
44
51
/**
@@ -57,10 +64,6 @@ export class DocsPage {
57
64
const { [ this . filterKey ] : filterValue } = queryParams ;
58
65
if ( filterValue ) {
59
66
this . filterValue = filterValue ;
60
- localStorage . setItem (
61
- getFilterKeyFromLocalStorage ( this . filterKey ) ,
62
- filterValue ,
63
- ) ;
64
67
this . setSelectedFilters ( { [ this . filterKey ] : this . filterValue } ) ;
65
68
}
66
69
}
You can’t perform that action at this time.
0 commit comments