File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
packages/mdjs-preview/src Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -44,17 +44,17 @@ function restoreSettings() {
44
44
for ( const _sharedStateKey of Object . keys ( _sharedStates ) ) {
45
45
const sharedStateKey = /** @type {keyof _sharedStates } */ ( _sharedStateKey ) ;
46
46
const restoredValue = localStorage . getItem ( `mdjsViewerSharedStates-${ sharedStateKey } ` ) ;
47
-
48
- switch ( sharedStateKey ) {
49
- case 'autoHeight' :
50
- case 'deviceMode' :
51
- case 'rememberSettings' :
52
- case 'edgeDistance' :
53
- _sharedStates [ sharedStateKey ] = restoredValue === 'true' ? true : false ;
54
- break ;
55
- default :
56
- _sharedStates [ sharedStateKey ] =
57
- restoredValue !== null ? restoredValue : _sharedStates [ sharedStateKey ] ;
47
+ if ( restoredValue !== null ) {
48
+ switch ( sharedStateKey ) {
49
+ case 'autoHeight' :
50
+ case 'deviceMode' :
51
+ case 'rememberSettings' :
52
+ case 'edgeDistance' :
53
+ _sharedStates [ sharedStateKey ] = restoredValue === 'true' ? true : false ;
54
+ break ;
55
+ default :
56
+ _sharedStates [ sharedStateKey ] = restoredValue ;
57
+ }
58
58
}
59
59
}
60
60
}
You can’t perform that action at this time.
0 commit comments