Re-run search whenever file list updates.
This commit is contained in:
@@ -79,6 +79,7 @@ export const useMainStore = defineStore('main', {
|
|||||||
connected: false,
|
connected: false,
|
||||||
authInProgress: false,
|
authInProgress: false,
|
||||||
cursor: '' as string,
|
cursor: '' as string,
|
||||||
|
lastSearchLoc: '' as string,
|
||||||
server: {} as Record<string, any> & {
|
server: {} as Record<string, any> & {
|
||||||
public?: boolean
|
public?: boolean
|
||||||
paskia?: boolean
|
paskia?: boolean
|
||||||
@@ -159,6 +160,10 @@ export const useMainStore = defineStore('main', {
|
|||||||
this.docVersion++
|
this.docVersion++
|
||||||
// Sync documents to search worker
|
// Sync documents to search worker
|
||||||
this.syncSearchWorker()
|
this.syncSearchWorker()
|
||||||
|
// Re-run the current search against the updated file list
|
||||||
|
if (this.query) {
|
||||||
|
this.search(this.query, this.lastSearchLoc)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** Patch aspect ratios on existing docs from a server ar update message */
|
/** Patch aspect ratios on existing docs from a server ar update message */
|
||||||
updateAr(arMap: Record<string, number>) {
|
updateAr(arMap: Record<string, number>) {
|
||||||
@@ -268,6 +273,7 @@ export const useMainStore = defineStore('main', {
|
|||||||
|
|
||||||
// Update query immediately so watchers know we're handling this
|
// Update query immediately so watchers know we're handling this
|
||||||
this.query = query
|
this.query = query
|
||||||
|
this.lastSearchLoc = loc
|
||||||
|
|
||||||
// Cancel pending timers
|
// Cancel pending timers
|
||||||
if (loadingTimer) {
|
if (loadingTimer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user