Skip to content

Commit

Permalink
chore: try to get over 80% threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideIadeluca committed Oct 27, 2024
1 parent a5d5571 commit 641e6b3
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import LinkButton from 'flarum/common/components/LinkButton';
import UserPage from 'flarum/forum/components/UserPage';
import RootMasqueradePane from './panes/RootMasqueradePane';

import type ItemList from 'flarum/common/utils/ItemList';
import type Mithril from 'mithril';

export default function addProfilePane() {
app.routes['fof-masquerade'] = {
path: '/u/:username/masquerade',
Expand All @@ -17,15 +20,15 @@ export default function addProfilePane() {
},
};

extend(UserPage.prototype, 'navItems', function (items) {
if (app.forum.attribute('canViewMasquerade') || this.user.canEditMasqueradeProfile()) {
const edit = this.user.canEditMasqueradeProfile();
extend(UserPage.prototype, 'navItems', function (items: ItemList<Mithril.Children>) {
if (app.forum.attribute('canViewMasquerade') || this.user?.canEditMasqueradeProfile()) {
const edit = this.user?.canEditMasqueradeProfile();

items.add(
'masquerade',
LinkButton.component(
{
href: app.route('fof-masquerade', { username: this.user.slug() }),
href: app.route('fof-masquerade', { username: this.user?.slug() }),
icon: 'far fa-id-card',
'data-editProfile': edit,
},
Expand Down

0 comments on commit 641e6b3

Please sign in to comment.