hotfix: don't use custom search endpoint when there is no search query
This commit is contained in:
parent
2f43fe2ae2
commit
70bffb7aa0
|
|
@ -6,6 +6,8 @@ import DiscussionListState from 'flarum/forum/states/DiscussionListState';
|
||||||
|
|
||||||
export default function extendDiscussionState() {
|
export default function extendDiscussionState() {
|
||||||
override(DiscussionListState.prototype, 'loadPage', async function (this: DiscussionListState, original, page: number = 1) {
|
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();
|
const params = this.requestParams();
|
||||||
params.page = {
|
params.page = {
|
||||||
offset: this.pageSize * (page - 1),
|
offset: this.pageSize * (page - 1),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue