bug fixes
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CI / general_module_workflow_js (push) Has been cancelled

This commit is contained in:
Dennis Eichhorn 2024-10-12 00:29:40 +00:00
parent a038d97a36
commit c8696fe445
2 changed files with 18 additions and 12 deletions

View File

@ -35,23 +35,29 @@ Autoloader.assetLoader = new AssetManager();
*/ */
Autoloader.defineNamespace = function (namespace) Autoloader.defineNamespace = function (namespace)
{ {
if (Autoloader.namespaced.indexOf(namespace) === -1) { if (Autoloader.namespaced.indexOf(namespace) !== -1) {
const paths = namespace.split('.'); return;
paths.splice(0, 1); }
const length = paths.length; const paths = namespace.split('.');
let current = window.omsApp; paths.splice(0, 1);
for (let i = 0; i < length; ++i) { const length = paths.length;
if (typeof current[paths[i]] === 'undefined') { let current = window.omsApp;
current[paths[i]] = {};
}
current = current[paths[i]]; if (typeof current === 'undefined') {
return;
}
for (let i = 0; i < length; ++i) {
if (typeof current[paths[i]] === 'undefined') {
current[paths[i]] = {};
} }
Autoloader.namespaced.push(namespace); current = current[paths[i]];
} }
Autoloader.namespaced.push(namespace);
}; };
/** /**

View File

@ -28,7 +28,7 @@ export class VoiceManager
this.recognition = null; this.recognition = null;
this.speechRecognitionList = null; this.speechRecognitionList = null;
if (SpeechRecognition !== null) { if (SpeechRecognition !== null && SpeechGrammarList !== null) {
this.recognition = new SpeechRecognition(); this.recognition = new SpeechRecognition();
this.speechRecognitionList = new SpeechGrammarList(); this.speechRecognitionList = new SpeechGrammarList();
} }