mirror of
https://github.com/flarum/framework.git
synced 2025-02-27 11:42:18 +08:00
Fix URL changing to homepage on 404
This commit is contained in:
parent
235dfebfd4
commit
897dd578b8
@ -24,6 +24,7 @@ import { flattenDeep } from 'lodash-es';
|
||||
import PageState from './states/PageState';
|
||||
import ModalManagerState from './states/ModalManagerState';
|
||||
import AlertManagerState from './states/AlertManagerState';
|
||||
import ErrorPage from './components/ErrorPage';
|
||||
|
||||
/**
|
||||
* The `App` class provides a container for an application, as well as various
|
||||
@ -199,6 +200,9 @@ export default class Application {
|
||||
|
||||
this.drawer = new Drawer();
|
||||
|
||||
// Needed so 404s don't get their URLs changed to the homepage.
|
||||
// Won't affect extension routes since its added last.
|
||||
this.routes.error = { path: '/:4xx...', component: ErrorPage };
|
||||
m.route(document.getElementById('content'), basePath + '/', mapRoutes(this.routes, basePath));
|
||||
|
||||
// Add a class to the body which indicates that the page has been scrolled
|
||||
|
Loading…
x
Reference in New Issue
Block a user