Skip to content

Commit

Permalink
Fix extension to work with latest state changes
Browse files Browse the repository at this point in the history
  • Loading branch information
franzliedke committed Jun 26, 2020
1 parent 96f09ab commit 30d2373
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/src/forum/addStickyControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default function addStickyControl() {

DiscussionControls.stickyAction = function() {
this.save({isSticky: !this.isSticky()}).then(() => {
if (app.current instanceof DiscussionPage) {
app.current.stream.update();
if (app.current.matches(DiscussionPage)) {
app.current.get('stream').update();
}

m.redraw();
Expand Down
4 changes: 2 additions & 2 deletions js/src/forum/addStickyExcerpt.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { extend } from 'flarum/extend';
import DiscussionList from 'flarum/components/DiscussionList';
import DiscussionListState from 'flarum/states/DiscussionListState';
import DiscussionListItem from 'flarum/components/DiscussionListItem';
import { truncate } from 'flarum/utils/string';

export default function addStickyControl() {
extend(DiscussionList.prototype, 'requestParams', function(params) {
extend(DiscussionListState.prototype, 'requestParams', function(params) {
params.include.push('firstPost');
});

Expand Down

0 comments on commit 30d2373

Please sign in to comment.