1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Document AdminApplication location fix

This commit is contained in:
Alexander Skvortsov
2020-09-04 17:37:28 -04:00
committed by Franz Liedke
parent 60dbd3f26c
commit c8d5ca51bb

View File

@@ -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 = '#';