@@ -117,7 +117,11 @@ class AuthClient extends pxt.auth.AuthClient {
117117 // Identity not available, read from local storage
118118 switch ( path ) {
119119 case HIGHCONTRAST : return / ^ t r u e $ / i. test ( pxt . storage . getLocal ( HIGHCONTRAST ) ) ;
120- case ACCESSIBLE_BLOCKS : return / ^ t r u e $ / i. test ( pxt . storage . getLocal ( ACCESSIBLE_BLOCKS ) ) ;
120+ case ACCESSIBLE_BLOCKS : {
121+ const stored = pxt . storage . getLocal ( ACCESSIBLE_BLOCKS ) ;
122+ if ( stored == null ) return core . isKeyboardControlsByDefault ( ) ;
123+ return / ^ t r u e $ / i. test ( stored ) ;
124+ }
121125 case COLOR_THEME_IDS : return pxt . U . jsonTryParse ( pxt . storage . getLocal ( COLOR_THEME_IDS ) ) as pxt . auth . ColorThemeIdsState ;
122126 case LANGUAGE : return pxt . storage . getLocal ( LANGUAGE ) ;
123127 case READER : return pxt . storage . getLocal ( READER ) ;
@@ -134,7 +138,7 @@ class AuthClient extends pxt.auth.AuthClient {
134138 switch ( field ) {
135139 case FIELD_USER_PREFERENCES : return { ...state . preferences } ;
136140 case FIELD_HIGHCONTRAST : return state . preferences ?. highContrast ?? pxt . auth . DEFAULT_USER_PREFERENCES ( ) . highContrast ;
137- case FIELD_KEYBOARD_CONTROLS : return state . preferences ?. accessibleBlocks ?? pxt . auth . DEFAULT_USER_PREFERENCES ( ) . accessibleBlocks ;
141+ case FIELD_KEYBOARD_CONTROLS : return state . preferences ?. accessibleBlocks ?? core . isKeyboardControlsByDefault ( ) ;
138142 case FIELD_COLOR_THEME_IDS : return state . preferences ?. colorThemeIds ?? pxt . auth . DEFAULT_USER_PREFERENCES ( ) . colorThemeIds ;
139143 case FIELD_LANGUAGE : return state . preferences ?. language ?? pxt . auth . DEFAULT_USER_PREFERENCES ( ) . language ;
140144 case FIELD_READER : return state . preferences ?. reader ?? pxt . auth . DEFAULT_USER_PREFERENCES ( ) . reader ;
@@ -250,6 +254,7 @@ export async function setAccessibleBlocksPrefAsync(accessibleBlocks: boolean, ev
250254 "auth.setAccessibleBlocks" ,
251255 {
252256 enabling : accessibleBlocks ? "true" : "false" ,
257+ defaultOn : core . isKeyboardControlsByDefault ( ) ? "true" : "false" ,
253258 eventSource : eventSource ,
254259 local : ! cli ? "true" : "false"
255260 }
0 commit comments