From 8a670155dbe28a8247c1af6bd40baf294c8b54f2 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 31 May 2023 18:23:57 +0600 Subject: [PATCH] Activity load fix (#3303) Signed-off-by: Denis Bykhov --- plugins/activity-resources/src/activity.ts | 4 ++-- .../activity-resources/src/components/Activity.svelte | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/activity-resources/src/activity.ts b/plugins/activity-resources/src/activity.ts index 896305c5f6..b614b9d561 100644 --- a/plugins/activity-resources/src/activity.ts +++ b/plugins/activity-resources/src/activity.ts @@ -47,7 +47,7 @@ function isEqualOps (op1: any, op2: any): boolean { /** * @public */ -export type DisplayTxListener = (txes: DisplayTx[]) => void +export type DisplayTxListener = (objectId: Ref, txes: DisplayTx[]) => void // Use 5 minutes to combine similar transactions. const combineThreshold = 5 * 60 * 1000 @@ -96,7 +96,7 @@ class ActivityImpl implements Activity { this.combineTransactions(objectId, this.ownTxes, this.attachedTxes, this.attacheChangedTxes, this.editable).then( (result) => { const sorted = result.sort((a, b) => (a.tx.modifiedOn - b.tx.modifiedOn) * sort) - listener(sorted) + listener(objectId, sorted) }, (err) => { console.error(err) diff --git a/plugins/activity-resources/src/components/Activity.svelte b/plugins/activity-resources/src/components/Activity.svelte index 9cf3928238..eb60496899 100644 --- a/plugins/activity-resources/src/components/Activity.svelte +++ b/plugins/activity-resources/src/components/Activity.svelte @@ -74,11 +74,13 @@ const res = activityQuery.update( objectId, objectClass, - (result) => { - txes = filterCollectionTxes(result) + (_id, result) => { + if (_id === objectId) { + txes = filterCollectionTxes(result) - if (txes.length > 0) { - loading = false + if (txes.length > 0) { + loading = false + } } }, SortingOrder.Ascending,