UBERF-5744: Fix exception on server (#4787)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-02-27 17:31:19 +07:00 committed by GitHub
parent bc86044bed
commit 0c8f00d24a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -463,6 +463,9 @@ export class LiveQuery implements WithTx, Client {
}
return toFindResult(this.clone(q.result), q.total) as FindResult<T>
}
if (current.result instanceof Promise) {
current.result = await current.result
}
return toFindResult(this.clone((current?.result as T[]) ?? []), current.total)
}