fix(search): clear searchUnchanged at start of every view()
Move the one-tick searchUnchanged flag to the top of view() so full and light polls both consume it once before async work begins. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -9760,6 +9760,8 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
|
|
||||||
async view (opts = {}) {
|
async view (opts = {}) {
|
||||||
const light = !!opts.light
|
const light = !!opts.light
|
||||||
|
const searchUnchangedForView = !!this._searchUnchanged
|
||||||
|
if (this._searchUnchanged) this._searchUnchanged = false
|
||||||
const user = this.identity.user
|
const user = this.identity.user
|
||||||
const guild = this.mode === 'guild' ? (this.guild?.guild || null) : null
|
const guild = this.mode === 'guild' ? (this.guild?.guild || null) : null
|
||||||
let channels = []
|
let channels = []
|
||||||
@@ -10645,11 +10647,7 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
)
|
)
|
||||||
: [],
|
: [],
|
||||||
searchScope: this._searchScope,
|
searchScope: this._searchScope,
|
||||||
searchUnchanged: (() => {
|
searchUnchanged: searchUnchangedForView,
|
||||||
const flag = !!this._searchUnchanged
|
|
||||||
if (this._searchUnchanged) this._searchUnchanged = false
|
|
||||||
return flag
|
|
||||||
})(),
|
|
||||||
forumIncludeArchived: this._forumIncludeArchived,
|
forumIncludeArchived: this._forumIncludeArchived,
|
||||||
searchResults: await this._resolveSearchResults({ light }),
|
searchResults: await this._resolveSearchResults({ light }),
|
||||||
searchResultsCached: !!this._lastSearchFromCache,
|
searchResultsCached: !!this._lastSearchFromCache,
|
||||||
|
|||||||
Reference in New Issue
Block a user