From 6183f25d46c05b431c9e35d3df4177138bca9d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Sun, 11 Jul 2021 12:13:54 +0200 Subject: [PATCH] no message --- dist/plex-meets-homeassistant.js | 14 +++++++------- src/plex-meets-homeassistant.ts | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 09ce1d5..95d7511 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -20538,12 +20538,10 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.loading = true; this.renderPage(); try { - if (this.plex) { - if (this.hassObj) { - this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter); - if (this.playController) { - await this.playController.init(); - } + if (this.plex && this.hassObj) { + this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter); + if (this.playController) { + await this.playController.init(); } await this.plex.init(); try { @@ -20620,7 +20618,9 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.render(); } else { - throw Error('Plex not initialized.'); + setTimeout(() => { + this.renderInitialData(); + }, 250); } } catch (err) { diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index 80e5f0b..d6d98e9 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -275,12 +275,10 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.loading = true; this.renderPage(); try { - if (this.plex) { - if (this.hassObj) { - this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter); - if (this.playController) { - await this.playController.init(); - } + if (this.plex && this.hassObj) { + this.playController = new PlayController(this.hassObj, this.plex, entity, this.runBefore, this.runAfter); + if (this.playController) { + await this.playController.init(); } await this.plex.init(); @@ -355,7 +353,9 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.loading = false; this.render(); } else { - throw Error('Plex not initialized.'); + setTimeout(() => { + this.renderInitialData(); + }, 250); } } catch (err) { this.error = `Plex server did not respond.
Details of the error: ${escapeHtml(err.message)}`;