Clear LQ results when refresh connect (#5101)

This commit is contained in:
Denis Bykhov 2024-03-30 17:46:51 +05:00 committed by GitHub
parent 693f3741f3
commit 75a3d845dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,6 +127,9 @@ export class LiveQuery implements WithTx, Client {
for (const q of [...this.queue]) {
if (!this.removeFromQueue(q)) {
try {
q.callbacks.forEach((callback) => {
callback(toFindResult([], 0))
})
void this.refresh(q)
} catch (err: any) {
if (err instanceof PlatformError) {
@ -141,6 +144,9 @@ export class LiveQuery implements WithTx, Client {
for (const v of this.queries.values()) {
for (const q of v) {
try {
q.callbacks.forEach((callback) => {
callback(toFindResult([], 0))
})
void this.refresh(q)
} catch (err: any) {
if (err instanceof PlatformError) {