@@ -19,7 +19,7 @@ import core, {
19
19
type Client ,
20
20
type Collection ,
21
21
type Doc ,
22
- groupByArray ,
22
+ groupByArrayAsync ,
23
23
type Hierarchy ,
24
24
type Mixin ,
25
25
type Ref ,
@@ -37,8 +37,7 @@ import {
37
37
import contact , { type Person } from '@hcengineering/contact'
38
38
import { type IntlString } from '@hcengineering/platform'
39
39
import { type AnyComponent } from '@hcengineering/ui'
40
- import { get } from 'svelte/store'
41
- import { personRefByPersonIdStore } from '@hcengineering/contact-resources'
40
+ import { getPersonRefByPersonId } from '@hcengineering/contact-resources'
42
41
import activity , {
43
42
type ActivityMessage ,
44
43
type DisplayActivityMessage ,
@@ -257,7 +256,10 @@ export async function combineActivityMessages (
257
256
258
257
const result : Array < DisplayActivityMessage | undefined > = [ ...uncombined ]
259
258
260
- const groupedByType : Map < string , DocUpdateMessage [ ] > = groupByArray ( docUpdateMessages , getDocUpdateMessageKey )
259
+ const groupedByType : Map < string , DocUpdateMessage [ ] > = await groupByArrayAsync (
260
+ docUpdateMessages ,
261
+ getDocUpdateMessageKey
262
+ )
261
263
262
264
for ( const [ , groupedMessages ] of groupedByType ) {
263
265
const cantMerge = groupedMessages . filter (
@@ -365,8 +367,8 @@ function groupByTime<T extends ActivityMessage> (messages: T[]): T[][] {
365
367
return result
366
368
}
367
369
368
- function getDocUpdateMessageKey ( message : DocUpdateMessage ) : string {
369
- const personRef = get ( personRefByPersonIdStore ) . get ( message . createdBy as any )
370
+ async function getDocUpdateMessageKey ( message : DocUpdateMessage ) : Promise < string > {
371
+ const personRef = await getPersonRefByPersonId ( message . createdBy as any )
370
372
371
373
if ( message . action === 'update' ) {
372
374
return [ message . _class , message . attachedTo , message . action , personRef , getAttributeUpdatesKey ( message ) ] . join ( '_' )
0 commit comments