@@ -42,6 +42,7 @@ export type AccountInboxStorageEntry = {
4242
4343export type SpaceStorageEntry = {
4444 id : string ;
45+ name : string ;
4546 events : SpaceEvent [ ] ;
4647 state : SpaceState | undefined ;
4748 keys : { id : string ; key : string } [ ] ;
@@ -85,7 +86,7 @@ type StoreEvent =
8586 | { type : 'reset' }
8687 | { type : 'addUpdateInFlight' ; updateId : string }
8788 | { type : 'removeUpdateInFlight' ; updateId : string }
88- | { type : 'setSpaceFromList' ; spaceId : string }
89+ | { type : 'setSpaceFromList' ; spaceId : string ; name : string }
8990 | { type : 'applyEvent' ; spaceId : string ; event : SpaceEvent ; state : SpaceState }
9091 | { type : 'updateConfirmed' ; spaceId : string ; clock : number }
9192 | { type : 'applyUpdate' ; spaceId : string ; firstUpdateClock : number ; lastUpdateClock : number }
@@ -122,6 +123,7 @@ type StoreEvent =
122123 | {
123124 type : 'setSpace' ;
124125 spaceId : string ;
126+ name : string ;
125127 updates ?: Updates ;
126128 events : SpaceEvent [ ] ;
127129 inboxes ?: SpaceInboxStorageEntry [ ] ;
@@ -170,7 +172,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
170172 updatesInFlight : context . updatesInFlight . filter ( ( id ) => id !== event . updateId ) ,
171173 } ;
172174 } ,
173- setSpaceFromList : ( context , event : { spaceId : string } ) => {
175+ setSpaceFromList : ( context , event : { spaceId : string ; name : string } ) => {
174176 if ( ! context . repo ) {
175177 return context ;
176178 }
@@ -188,6 +190,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
188190 if ( existingSpace . id === event . spaceId ) {
189191 const newSpace : SpaceStorageEntry = {
190192 id : existingSpace . id ,
193+ name : existingSpace . name ,
191194 events : existingSpace . events ?? [ ] ,
192195 state : existingSpace . state ,
193196 keys : existingSpace . keys ?? [ ] ,
@@ -210,6 +213,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
210213 ...context . spaces ,
211214 {
212215 id : event . spaceId ,
216+ name : event . name ,
213217 events : [ ] ,
214218 state : undefined ,
215219 keys : [ ] ,
@@ -398,6 +402,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
398402 context ,
399403 event : {
400404 spaceId : string ;
405+ name : string ;
401406 updates ?: Updates ;
402407 inboxes ?: SpaceInboxStorageEntry [ ] ;
403408 events : SpaceEvent [ ] ;
@@ -415,6 +420,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
415420 result . handle . doneLoading ( ) ;
416421
417422 const newSpace : SpaceStorageEntry = {
423+ name : event . name ,
418424 id : event . spaceId ,
419425 events : event . events ,
420426 state : event . spaceState ,
0 commit comments