Swallow getLayoutMap() error (#2790)

* Fix getLayoutMap() bug

* Update CHANGELOG.md

---------

Co-authored-by: Angus <angus@coefficient.io>
Co-authored-by: Peter <specc.dev@gmail.com>
This commit is contained in:
Angus MacIsaac 2024-09-13 19:00:52 -03:00 committed by GitHub
commit 2f9696a000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -3,6 +3,7 @@
### 2.30.6
`Fix` Fix the display of Convert To near blocks that do not have the conversionConfig.export rule specified
`Fix` The Plus button does not appear when the editor is loaded in an iframe in Chrome
### 2.30.5

View file

@ -47,8 +47,15 @@ export async function getKeyboardKeyForCode(code: string, fallback: string): Pro
return fallback;
}
const map = await keyboard.getLayoutMap();
const key = map.get(code);
try {
const map = await keyboard.getLayoutMap();
return key || fallback;
const key = map.get(code);
return key || fallback;
} catch (e) {
console.error(e);
return fallback;
}
}