mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-17 18:05:42 +02:00
Fix query refresh (#89)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -178,6 +178,9 @@ export class CollaboratorsQuery implements Query<Collaborator, FindCollaborators
|
||||
|
||||
public async refresh (): Promise<void> {
|
||||
this.result = new QueryResult([] as Collaborator[], (c) => c.account)
|
||||
await this.initResult()
|
||||
this.result = this.initResult()
|
||||
void this.result.then(() => {
|
||||
void this.notify()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,6 +254,9 @@ export class LabelsQuery implements Query<Label, FindLabelsParams> {
|
||||
|
||||
async refresh (): Promise<void> {
|
||||
this.result = new QueryResult([] as Label[], getId)
|
||||
await this.initResult()
|
||||
this.result = this.initResult()
|
||||
void this.result.then(() => {
|
||||
void this.notify()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -880,10 +880,14 @@ export class MessagesQuery implements PagedQuery<Message, MessageQueryParams> {
|
||||
this.tmpMessages.clear()
|
||||
|
||||
this.result = new QueryResult([] as Message[], (x) => x.id)
|
||||
this.result.setTail(this.params.from == null)
|
||||
this.result.setHead(this.params.from == null)
|
||||
this.initialized = false
|
||||
|
||||
if (this.isInitLoadingForward()) {
|
||||
this.result.setHead(this.params.from == null)
|
||||
} else {
|
||||
this.result.setTail(this.params.from == null)
|
||||
}
|
||||
|
||||
for (let i = 0; i < nextPagesCount; i++) {
|
||||
const { isDone } = await this.requestLoadNextPage(false)
|
||||
this.initialized = true
|
||||
|
||||
Reference in New Issue
Block a user