mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
Activity load fix (#3303)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
13c655344a
commit
8a670155db
@ -47,7 +47,7 @@ function isEqualOps (op1: any, op2: any): boolean {
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type DisplayTxListener = (txes: DisplayTx[]) => void
|
||||
export type DisplayTxListener = (objectId: Ref<Doc>, 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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user