File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
frontend/src/components/Topics/List Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ const ListPage: React.FC = () => {
22
22
if ( ! searchParams . has ( 'perPage' ) ) {
23
23
searchParams . set ( 'perPage' , String ( PER_PAGE ) ) ;
24
24
}
25
- if (
26
- ! ! localStorage . getItem ( 'hideInternalTopics' ) &&
27
- ! searchParams . has ( 'hideInternal' )
28
- ) {
29
- searchParams . set ( 'hideInternal' , 'true' ) ;
25
+ // If URL doesn't specify it, derive from localStorage (default = true when missing)
26
+ if ( ! searchParams . has ( 'hideInternal' ) ) {
27
+ const stored = localStorage . getItem ( 'hideInternalTopics' ) ;
28
+ const shouldHide = stored === null ? true : stored === 'true' ;
29
+ searchParams . set ( 'hideInternal' , String ( shouldHide ) ) ;
30
+ // persist the default so it sticks across pages
31
+ if ( stored === null ) localStorage . setItem ( 'hideInternalTopics' , 'true' ) ;
30
32
}
31
33
setSearchParams ( searchParams ) ;
32
34
} , [ ] ) ;
You can’t perform that action at this time.
0 commit comments