hotfix: don't use custom search endpoint when there is no search query

This commit is contained in:
David Wheatley 2021-10-22 18:57:43 +01:00
parent 2f43fe2ae2
commit 70bffb7aa0
No known key found for this signature in database
GPG Key ID: DCC0FCE349280DFF
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,8 @@ import DiscussionListState from 'flarum/forum/states/DiscussionListState';
export default function extendDiscussionState() {
override(DiscussionListState.prototype, 'loadPage', async function (this: DiscussionListState, original, page: number = 1) {
if (!this.requestParams().q?.length) return original.call(this, page);
const params = this.requestParams();
params.page = {
offset: this.pageSize * (page - 1),