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 = {}) {
|
||||
const light = !!opts.light
|
||||
const searchUnchangedForView = !!this._searchUnchanged
|
||||
if (this._searchUnchanged) this._searchUnchanged = false
|
||||
const user = this.identity.user
|
||||
const guild = this.mode === 'guild' ? (this.guild?.guild || null) : null
|
||||
let channels = []
|
||||
@@ -10645,11 +10647,7 @@ class PearcordPlatform extends EventEmitter {
|
||||
)
|
||||
: [],
|
||||
searchScope: this._searchScope,
|
||||
searchUnchanged: (() => {
|
||||
const flag = !!this._searchUnchanged
|
||||
if (this._searchUnchanged) this._searchUnchanged = false
|
||||
return flag
|
||||
})(),
|
||||
searchUnchanged: searchUnchangedForView,
|
||||
forumIncludeArchived: this._forumIncludeArchived,
|
||||
searchResults: await this._resolveSearchResults({ light }),
|
||||
searchResultsCached: !!this._lastSearchFromCache,
|
||||
|
||||
Reference in New Issue
Block a user