fix(web): crash on focus before init

Fixes the following crash noted when testing on keymanweb.com, focusing
during the load process on a slow network.

```
helpers.ts:111 Uncaught TypeError: Cannot read properties of null (reading 'vkbd')
    at g.pageFocusHandler (keymanweb.ts:125:44)
    at sentryWrapped (helpers.ts:87:17)
```
This commit is contained in:
Marc Durdin 2022-03-17 15:50:52 +11:00
parent f28b38a1e8
commit e3537e7bb7

View file

@ -122,7 +122,7 @@ if(!window['keyman']['initialized']) {
**/
function resetVKShift() {
let keyman = com.keyman.singleton;
if(!keyman.uiManager.isActivating && keyman.osk.vkbd) {
if(!keyman.uiManager.isActivating && keyman.osk?.vkbd) {
keyman.core.keyboardProcessor._UpdateVKShift(null); //this should be enabled !!!!! TODO
}
}