@samitouri / QOSami-HFS / commits / 727831de

fix: admin/plugins/get-more: changing the search-text while getting results caused inconsistency

Massimo Melina committed Apr 4, 2026 at 20:56 UTC 727831ded7cd98c65899205f7ea5204ef27439b4
1 file changed +6 -3
admin/src/api.ts
+6 -3
@@ -85,6 +85,8 @@ export function useApiList<T=any, S=T>(cmd:string|Falsy, params: Dict={}, { map,
85 case 'closed':
86 return stop()
87 case 'msg':
88 + if (src.readyState !== src.OPEN)
89 + return stop()
90 const removeOnList: ReturnType<typeof _.matches>[] = []
91 const updateOnList: [object,object][] = []
92 wantArray(data).forEach(msg => {
@@ -149,12 +151,13 @@ export function useApiList<T=any, S=T>(cmd:string|Falsy, params: Dict={}, { map,
151 }
152 return ret
153 })
152 - if (src.readyState === src.CLOSED)
153 - stop()
154 }
155 })
156
157 - return () => src.close()
157 + return () => {
158 + apply.cancel()
159 + src.close()
160 + }
161
162 function stop() {
163 setInitializing(false)