From 33124030f6d119ad3a58cb520062f2aa58022c6d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 28 Nov 2015 22:12:45 -0800 Subject: [PATCH] Bit more robust icon loading --- src/home-assistant.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/home-assistant.js b/src/home-assistant.js index c7d0bf1401..0e0b0a4b40 100644 --- a/src/home-assistant.js +++ b/src/home-assistant.js @@ -54,9 +54,12 @@ export default new Polymer({ }, loadIcons() { + // If the import fails, we'll try to import again, must be a server glitch + // Since HTML imports only resolve once, we import another url. + const success = () => this.iconsLoaded = true; this.importHref(`/static/mdi-${this.icons}.html`, - () => this.iconsLoaded = true, - () => this.loadIcons()); + success, + this.importHref(`/static/mdi.html`, success, success)); }, ready() {