Fix demo routing (#2599)

This commit is contained in:
Paulus Schoutsen 2019-01-27 16:55:47 -08:00 committed by GitHub
parent c3f473c3e7
commit 13adee09da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}