Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix demo routing #2599

Merged
merged 1 commit into from Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/webpack.config.js
Expand Up @@ -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;

Expand Down
6 changes: 4 additions & 2 deletions src/layouts/app/home-assistant.ts
Expand Up @@ -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;
}
Expand Down