mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
Remove "custom" home page input
Also add an API to let extensions define additional default route options. Allowing default routes with parameters (e.g. /d/123) is very difficult because of the way Mithril routing works, and it doesn't have a convincing use-case to justify the trouble. So I've removed the custom input altogether. closes #427
This commit is contained in:
@@ -24,14 +24,15 @@ export default function boot(app) {
|
||||
// able to click on the 'back' button to go home, regardless of which page
|
||||
// they started on.
|
||||
const defaultRoute = app.forum.attribute('defaultRoute');
|
||||
let defaultAction = 'index';
|
||||
|
||||
for (const i in app.routes) {
|
||||
if (app.routes[i].path === defaultRoute) {
|
||||
app.routes[i].path = '/';
|
||||
app.history.push(i, '/');
|
||||
}
|
||||
if (app.routes[i].path === defaultRoute) defaultAction = i;
|
||||
}
|
||||
|
||||
app.routes[defaultAction].path = '/';
|
||||
app.history.push(defaultAction, '/');
|
||||
|
||||
m.startComputation();
|
||||
|
||||
m.mount(document.getElementById('app-navigation'), Navigation.component({className: 'App-backControl', drawer: true}));
|
||||
|
Reference in New Issue
Block a user