Skip to content

Commit

Permalink
chore: major frontend JS cleanup (#3609)
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat authored May 7, 2023
1 parent 6718886 commit a9bff1e
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions js/src/forum/index.ts → js/src/forum/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,21 @@ app.initializers.add('flarum-pusher', () => {

if (count && typeof vdom === 'object' && vdom && 'children' in vdom && vdom.children instanceof Array) {
vdom.children.unshift(
Button.component(
{
className: 'Button Button--block DiscussionList-update',
onclick: () => {
this.attrs.state.refresh().then(() => {
this.loadingUpdated = false;
app.pushedUpdates = [];
app.setTitleCount(0);
m.redraw();
});
this.loadingUpdated = true;
},
loading: this.loadingUpdated,
},
app.translator.trans('flarum-pusher.forum.discussion_list.show_updates_text', { count })
)
<Button
className="Button Button--block DiscussionList-update"
onclick={() => {
this.attrs.state.refresh().then(() => {
this.loadingUpdated = false;
app.pushedUpdates = [];
app.setTitleCount(0);
m.redraw();
});
this.loadingUpdated = true;
}}
loading={this.loadingUpdated}
>
{app.translator.trans('flarum-pusher.forum.discussion_list.show_updates_text', { count })}
</Button>
);
}
}
Expand Down

0 comments on commit a9bff1e

Please sign in to comment.