From 13adee09da24a7317516f7b97c031f5ff9863e3b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 27 Jan 2019 16:55:47 -0800 Subject: [PATCH] Fix demo routing (#2599) --- demo/webpack.config.js | 2 +- src/layouts/app/home-assistant.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 2e87ffd692..851a983f30 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -8,7 +8,7 @@ const { minimizer } = require("../config/babel.js"); const isProd = process.env.NODE_ENV === "production"; const chunkFilename = isProd ? "chunk.[chunkhash].js" : "[name].chunk.js"; const buildPath = path.resolve(__dirname, "dist"); -const publicPath = "./"; +const publicPath = "/"; const latestBuild = false; diff --git a/src/layouts/app/home-assistant.ts b/src/layouts/app/home-assistant.ts index 3724fac607..46fc89a84f 100644 --- a/src/layouts/app/home-assistant.ts +++ b/src/layouts/app/home-assistant.ts @@ -98,10 +98,12 @@ export class HomeAssistantAppEl extends ext(HassBaseMixin(LitElement), [ private _routeChanged(ev) { const route = ev.detail.value as Route; - // If it's the first route that we process, // check if we should navigate away from / - if (this._route === undefined && route.path === "/") { + if ( + this._route === undefined && + (route.path === "" || route.path === "/") + ) { navigate(window, `/${localStorage.defaultPage || DEFAULT_PANEL}`, true); return; }