Merge pull request #4286 from keymanapp/fix/web/4285-single-font-defined

fix(web): better font-wait null guards
This commit is contained in:
Joshua Horton 2021-01-19 09:35:51 +07:00 • committed by GitHub
commit dbcc7dfdee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2590,14 +2590,14 @@ namespace com.keyman.osk {
let keymanweb = com.keyman.singleton;
let util = keymanweb.util;
if(typeof(kfd) == 'undefined' && typeof(ofd) == 'undefined') {
return true;
}
let fontDefined = !!(kfd && kfd['files']);
kfd = fontDefined ? kfd : undefined;
if(typeof(kfd['files']) == 'undefined' && typeof(ofd['files']) == 'undefined') {
return true;
}
let oskFontDefined = !!(ofd && ofd['files']);
ofd = oskFontDefined ? ofd : undefined;
// Automatically 'ready' if the descriptor is explicitly `undefined`.
// Thus, also covers the case where both are undefined.
var kReady=util.checkFontDescriptor(kfd), oReady=util.checkFontDescriptor(ofd);
if(kReady && oReady) {
return true;