@@ -14,7 +14,12 @@ import type { Stores } from '$common/stores'
14
14
import type { Session } from '$modules/session/session.types'
15
15
import { applyAccountEvent , type AccountAggregate } from '$modules/account/account.state'
16
16
import { applyAttributeEvent , type AttributeAggregate } from '$modules/attribute/attribute.state'
17
- import { applyInviteEvent , type InviteAggregate } from '$modules/invite/invite.state'
17
+ import {
18
+ applyInviteEvent ,
19
+ applyPendingConnectionEvent ,
20
+ type InviteAggregate ,
21
+ type PendingConnectionAggregate
22
+ } from '$modules/invite/invite.state'
18
23
import {
19
24
applyConnectionEvent ,
20
25
type ConnectionAggregate
@@ -105,6 +110,14 @@ function contextProtocolFactory({ cache, stores, commuter }: Dependencies): Cont
105
110
return aggregate
106
111
} )
107
112
113
+ stores . invite . pendingConnections . update ( ( state ) => {
114
+ let aggregate : PendingConnectionAggregate = state || new Map ( )
115
+ events . forEach ( ( event ) => {
116
+ aggregate = applyPendingConnectionEvent ( aggregate , event )
117
+ } )
118
+ return aggregate
119
+ } )
120
+
108
121
stores . connection . update ( ( state ) => {
109
122
let aggregate : ConnectionAggregate = state || new Map ( )
110
123
events . forEach ( ( event ) => {
@@ -188,18 +201,21 @@ function contextProtocolFactory({ cache, stores, commuter }: Dependencies): Cont
188
201
let accountAggregate : AccountAggregate = { } as AccountAggregate
189
202
let attributeAggregate : AttributeAggregate = new Map ( )
190
203
let inviteAggregate : InviteAggregate = new Map ( )
204
+ let pendingConnectionAggregate : PendingConnectionAggregate = new Map ( )
191
205
let connectionAggregate : ConnectionAggregate = new Map ( )
192
206
193
207
events . forEach ( ( event ) => {
194
208
accountAggregate = applyAccountEvent ( accountAggregate , event )
195
209
attributeAggregate = applyAttributeEvent ( attributeAggregate , event )
196
210
inviteAggregate = applyInviteEvent ( inviteAggregate , event )
211
+ pendingConnectionAggregate = applyPendingConnectionEvent ( pendingConnectionAggregate , event )
197
212
connectionAggregate = applyConnectionEvent ( connectionAggregate , event )
198
213
} )
199
214
200
215
stores . account . set ( accountAggregate )
201
216
stores . attribute . set ( attributeAggregate )
202
217
stores . invite . invites . set ( inviteAggregate )
218
+ stores . invite . pendingConnections . set ( pendingConnectionAggregate )
203
219
stores . connection . set ( connectionAggregate )
204
220
}
205
221
}
0 commit comments