Improved thread safety

This commit is contained in:
2022-08-16 20:42:35 +00:00
parent ae9ffb65c1
commit 39f727206f
11 changed files with 82 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ export const ConnectionMixin = (SuperClass) => {
public browserEntities = {};
LOG(...args) {
return;
if (window.browser_mod_log === undefined) return;
const dt = new Date();
console.log(`${dt.toLocaleTimeString()}`, ...args);
@@ -37,6 +37,7 @@ export const ConnectionMixin = (SuperClass) => {
this.update_config(msg.result);
}
this._connectionResolve?.();
this._connectionResolve = undefined;
}
private update_config(cfg) {

View File

@@ -32,6 +32,7 @@ interface FullyKiosk {
declare global {
interface Window {
browser_mod?: BrowserMod;
browser_mod_log?: any;
fully?: FullyKiosk;
hassConnection?: Promise<any>;
customCards?: [{}?];