1
0
mirror of https://github.com/flarum/core.git synced 2025-07-18 07:11:17 +02:00

Navigate to dashboard page if extension ID not found (#2584)

This commit is contained in:
David Sevilla Martín
2021-01-30 17:45:20 -05:00
committed by GitHub
parent fea657e35b
commit cf85181e3e

View File

@@ -32,6 +32,10 @@ export default class ExtensionPage extends Page {
source: 'fas fa-code', source: 'fas fa-code',
}; };
if (!this.extension) {
return m.route.set(app.route('dashboard'));
}
// Backwards compatibility layer will be removed in // Backwards compatibility layer will be removed in
// Beta 16 // Beta 16
if (app.extensionSettings[this.extension.id]) { if (app.extensionSettings[this.extension.id]) {
@@ -40,10 +44,14 @@ export default class ExtensionPage extends Page {
} }
className() { className() {
if (!this.extension) return '';
return this.extension.id + '-Page'; return this.extension.id + '-Page';
} }
view() { view() {
if (!this.extension) return null;
return ( return (
<div className={'ExtensionPage ' + this.className()}> <div className={'ExtensionPage ' + this.className()}>
{this.header()} {this.header()}