mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 12:43:52 +08:00
Fix extension to work with latest state changes
Refs flarum/core#2150, flarum/core#2156.
This commit is contained in:
parent
ce66d7d43b
commit
38be86ec51
|
@ -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();
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user