Don't try load_lovelace until it succeeds.

This commit is contained in:
Thomas Lovén 2019-12-08 20:28:53 +01:00
parent ffc8d5fc2e
commit 9fcfff81c6
3 changed files with 10 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -37,8 +37,14 @@ class BrowserMod {
window.browser_mod.playedOnce = true;
}
_load_lovelace() {
if(!load_lovelace()) {
let timer = window.setTimeout(this._load_lovelace.bind(this), 100);
}
}
constructor() {
window.setTimeout(load_lovelace, 500);
window.setTimeout(this._load_lovelace.bind(this), 500);
window.hassConnection.then((conn) => this.connect(conn.conn));
this.player = new Audio();
this.playedOnce = false;

2
package-lock.json generated
View File

@ -627,7 +627,7 @@
"dev": true
},
"card-tools": {
"version": "github:thomasloven/lovelace-card-tools#a38da04024d3b9411d706e10883e9281cd9c3426",
"version": "github:thomasloven/lovelace-card-tools#8790289006f110d7aefb8cf7ab1bacdad3c620b0",
"from": "github:thomasloven/lovelace-card-tools"
},
"chalk": {