Catch LL config not found exception in preload (#5340)

This commit is contained in:
Paulus Schoutsen 2020-03-26 02:47:12 -07:00 committed by GitHub
parent a17c1052cd
commit cc046478e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,12 +92,12 @@ window.hassConnection.then(({ conn }) => {
subscribeFrontendUserData(conn, "core", noop); subscribeFrontendUserData(conn, "core", noop);
if (location.pathname === "/" || location.pathname.startsWith("/lovelace/")) { if (location.pathname === "/" || location.pathname.startsWith("/lovelace/")) {
(window as WindowWithLovelaceProm).llConfProm = fetchConfig( const llWindow = window as WindowWithLovelaceProm;
conn, llWindow.llConfProm = fetchConfig(conn, null, false);
null, llWindow.llConfProm.catch(() => {
false // Ignore it, it is handled by Lovelace panel.
); });
(window as WindowWithLovelaceProm).llResProm = fetchResources(conn); llWindow.llResProm = fetchResources(conn);
} }
}); });