From bdbacdd3ba176b99d89cf5f68784e71c5dec7bc1 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Fri, 22 Sep 2023 20:39:54 +0100 Subject: [PATCH] refactor: no longer need to push gambits to `q` --- .../js/src/forum/addSubscriptionFilter.js | 7 +------ extensions/tags/js/src/forum/addTagFilter.tsx | 10 ++-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/extensions/subscriptions/js/src/forum/addSubscriptionFilter.js b/extensions/subscriptions/js/src/forum/addSubscriptionFilter.js index ed950fff1e..d9a29d23b0 100644 --- a/extensions/subscriptions/js/src/forum/addSubscriptionFilter.js +++ b/extensions/subscriptions/js/src/forum/addSubscriptionFilter.js @@ -35,12 +35,7 @@ export default function addSubscriptionFilter() { extend(DiscussionListState.prototype, 'requestParams', function (params) { if (this.params.onFollowing) { params.filter ||= {}; - - if (params.filter.q) { - params.filter.q += ' is:following'; - } else { - params.filter.subscription = 'following'; - } + params.filter.subscription = 'following'; } }); } diff --git a/extensions/tags/js/src/forum/addTagFilter.tsx b/extensions/tags/js/src/forum/addTagFilter.tsx index b2742bdb72..55dc73577c 100644 --- a/extensions/tags/js/src/forum/addTagFilter.tsx +++ b/extensions/tags/js/src/forum/addTagFilter.tsx @@ -117,14 +117,8 @@ export default function addTagFilter() { } if (this.params.tags) { - const filter = params.filter ?? {}; - filter.tag = this.params.tags; - // TODO: replace this with a more robust system. - const q = filter.q; - if (q) { - filter.q = `${q} tag:${this.params.tags}`; - } - params.filter = filter; + params.filter ||= {}; + params.filter.tag = this.params.tags; } }); }