clarkwinkelmann Ok Thanks for letting me know I did very silly mistake. 😅
import { extend } from 'flarum/common/extend';
import app from 'flarum/forum/app';
import HeaderPrimary from 'flarum/components/HeaderPrimary'
/* RameshDADA Ultra Premium */
app.initializers.add('ramesh-dada-premium-navigation', () => {
extend(HeaderPrimary.prototype, 'view', (component) => {
if (app.session.user === user) {
items.add(
'newDiscussion',
m("nav", { "class": "RAMmenu", "style": { "display": "none" } },
[
m("a", { "class": "menu-item gharkhel", onclick: () => gharchalo() },
m("i", { "class": "fas fa-home rameshtab" })
),
m("a", { "class": "menu-item", onclick: () => tagsde() },
m("i", { "class": "fas fa-tags rameshtab" })
),
m("a", { "class": "menu-item NayaShruKar", onclick: () => newDiscussRamesh() },
m("i", { "class": "fas fa-plus rameshtab" })
),
m("a", { "class": "menu-item hotelkhel", onclick: () => replykaro() },
m("i", { "class": "fas fa-comment-dots rameshtab" })
),
m("a", { "class": "menu-item", onclick: () => settingsWala() },
m("i", { "class": "fas fa-user-shield rameshtab" })
),
m("a", { "class": "menu-item", onclick: () => notifierM() },
m("i", { "class": "fas fa-bell rameshtab" })
)
]
)
);
}
});
function newDiscussRamesh() {
document.querySelector('.IndexPage-newDiscussion').click();
}
function gharchalo() {
document.querySelector('#home-link').click();
}
function replykaro() {
document.querySelector('.PostStream-item .ReplyPlaceholder').click();
}
function tagsde() {
m.route.set(app.forum.attribute('home_page') + 'tags');
}
function notifierM() {
m.route.set(app.forum.attribute('home_page') + 'notifications');
}
function settingsWala() {
m.route.set(app.forum.attribute('home_page') + 'settings');
}
});
Clark Brother but still it doesn't seems to work now! 😟 It also breaks Flarum!