@@ -43,6 +43,7 @@ export type AccountInboxStorageEntry = {
4343
4444export type SpaceStorageEntry = {
4545 id : string ;
46+ name : string ;
4647 events : SpaceEvent [ ] ;
4748 state : SpaceState | undefined ;
4849 keys : { id : string ; key : string } [ ] ;
@@ -89,7 +90,7 @@ type StoreEvent =
8990 | { type : 'reset' }
9091 | { type : 'addUpdateInFlight' ; updateId : string }
9192 | { type : 'removeUpdateInFlight' ; updateId : string }
92- | { type : 'setSpaceFromList' ; spaceId : string }
93+ | { type : 'setSpaceFromList' ; spaceId : string ; name : string }
9394 | { type : 'applyEvent' ; spaceId : string ; event : SpaceEvent ; state : SpaceState }
9495 | { type : 'updateConfirmed' ; spaceId : string ; clock : number }
9596 | { type : 'applyUpdate' ; spaceId : string ; firstUpdateClock : number ; lastUpdateClock : number }
@@ -126,6 +127,7 @@ type StoreEvent =
126127 | {
127128 type : 'setSpace' ;
128129 spaceId : string ;
130+ name : string ;
129131 updates ?: Updates ;
130132 events : SpaceEvent [ ] ;
131133 inboxes ?: SpaceInboxStorageEntry [ ] ;
@@ -180,7 +182,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
180182 updatesInFlight : context . updatesInFlight . filter ( ( id ) => id !== event . updateId ) ,
181183 } ;
182184 } ,
183- setSpaceFromList : ( context , event : { spaceId : string } ) => {
185+ setSpaceFromList : ( context , event : { spaceId : string ; name : string } ) => {
184186 if ( ! context . repo ) {
185187 return context ;
186188 }
@@ -198,6 +200,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
198200 if ( existingSpace . id === event . spaceId ) {
199201 const newSpace : SpaceStorageEntry = {
200202 id : existingSpace . id ,
203+ name : existingSpace . name ,
201204 events : existingSpace . events ?? [ ] ,
202205 state : existingSpace . state ,
203206 keys : existingSpace . keys ?? [ ] ,
@@ -220,6 +223,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
220223 ...context . spaces ,
221224 {
222225 id : event . spaceId ,
226+ name : event . name ,
223227 events : [ ] ,
224228 state : undefined ,
225229 keys : [ ] ,
@@ -408,6 +412,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
408412 context ,
409413 event : {
410414 spaceId : string ;
415+ name : string ;
411416 updates ?: Updates ;
412417 inboxes ?: SpaceInboxStorageEntry [ ] ;
413418 events : SpaceEvent [ ] ;
@@ -425,6 +430,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
425430 result . handle . doneLoading ( ) ;
426431
427432 const newSpace : SpaceStorageEntry = {
433+ name : event . name ,
428434 id : event . spaceId ,
429435 events : event . events ,
430436 state : event . spaceState ,
0 commit comments