File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ async function updateConsolePreferences(store: PreferencesStore): Promise<void>
37
37
}
38
38
39
39
currentPreferences . console = {
40
- ...( currentPreferences [ ' console' ] ?? { } ) ,
40
+ ...( currentPreferences . console ?? { } ) ,
41
41
...store
42
42
} ;
43
43
@@ -50,13 +50,19 @@ function createPreferences() {
50
50
51
51
if ( browser ) {
52
52
// fresh fetch.
53
- sdk . forConsole . account . getPrefs ( ) . then ( ( userPreferences ) => {
54
- if ( ! userPreferences ?. console || Array . isArray ( userPreferences . console ) ) {
55
- userPreferences . console = { } ;
56
- }
53
+ sdk . forConsole . account
54
+ . getPrefs ( )
55
+ . then ( ( userPreferences ) => {
56
+ if ( ! userPreferences ?. console || Array . isArray ( userPreferences . console ) ) {
57
+ userPreferences . console = { } ;
58
+ }
57
59
58
- set ( userPreferences . console ) ;
59
- } ) ;
60
+ set ( userPreferences . console ) ;
61
+ } )
62
+ . catch ( ( ) => {
63
+ // exception is thrown if there's no session; in that case - fallback!
64
+ set ( JSON . parse ( globalThis . localStorage . getItem ( 'preferences' ) ?? '{}' ) ) ;
65
+ } ) ;
60
66
}
61
67
62
68
subscribe ( ( v ) => {
You can’t perform that action at this time.
0 commit comments