From c8d5ca51bb15f04e7f2ffad51c4f091b0675af03 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Fri, 4 Sep 2020 17:37:28 -0400 Subject: [PATCH] Document AdminApplication location fix --- js/src/admin/AdminApplication.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/admin/AdminApplication.js b/js/src/admin/AdminApplication.js index bc6426094..61fcbeb03 100644 --- a/js/src/admin/AdminApplication.js +++ b/js/src/admin/AdminApplication.js @@ -33,6 +33,9 @@ export default class AdminApplication extends Application { m.mount(document.getElementById('header-secondary'), HeaderSecondary); m.mount(document.getElementById('admin-navigation'), AdminNav); + // With mithril 0.2.x, mithril redirects to the route with the hash automatically. + // With 2.x, it does not do that, so it doesn't display the home route in the admin. + // This code makes sure that going to https://example.com/admin takes us to the right page. if (!document.location.hash) document.location.hash = '#/'; m.route.prefix = '#';