Skip to content

Commit c9aeda2

Browse files
committed
refactor: replace extend with beforeMount
1 parent 1cef4c2 commit c9aeda2

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

js/src/forum/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import Application from 'flarum/common/Application';
2-
import { extend } from 'flarum/common/extend';
31
import app from 'flarum/forum/app';
42
import MobileTab from './components/MobileTab';
53

64
export { default as extend } from './extend';
75

86
app.initializers.add('acpl/mobile-tab', () => {
9-
//@ts-ignore - missing 'mount' types
10-
extend(Application.prototype, 'mount', () => {
11-
const mTab = document.createElement('div');
12-
m.mount(document.body.appendChild(mTab), MobileTab);
7+
app.beforeMount(() => {
8+
m.mount(document.body.appendChild(document.createElement('div')), MobileTab);
139
});
1410
});

0 commit comments

Comments
 (0)