Fix extension to work with latest state changes

Refs flarum/core#2150.
This commit is contained in:
Franz Liedke 2020-06-26 16:06:16 +02:00
parent 6c6975a750
commit 04ee85f266

View File

@ -1,7 +1,7 @@
import { extend } from 'flarum/extend';
import LinkButton from 'flarum/components/LinkButton';
import IndexPage from 'flarum/components/IndexPage';
import DiscussionList from 'flarum/components/DiscussionList';
import DiscussionListState from 'flarum/states/DiscussionListState';
export default function addSubscriptionFilter() {
extend(IndexPage.prototype, 'navItems', function(items) {
@ -24,8 +24,8 @@ export default function addSubscriptionFilter() {
}
});
extend(DiscussionList.prototype, 'requestParams', function(params) {
if (this.props.params.filter === 'following') {
extend(DiscussionListState.prototype, 'requestParams', function(params) {
if (this.params.filter === 'following') {
params.filter.q = (params.filter.q || '') + ' is:following';
}
});