@@ -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 }
@@ -170,7 +171,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
170171 updatesInFlight : context . updatesInFlight . filter ( ( id ) => id !== event . updateId ) ,
171172 } ;
172173 } ,
173- setSpaceFromList : ( context , event : { spaceId : string } ) => {
174+ setSpaceFromList : ( context , event : { spaceId : string ; name : string } ) => {
174175 if ( ! context . repo ) {
175176 return context ;
176177 }
@@ -188,6 +189,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
188189 if ( existingSpace . id === event . spaceId ) {
189190 const newSpace : SpaceStorageEntry = {
190191 id : existingSpace . id ,
192+ name : existingSpace . name ,
191193 events : existingSpace . events ?? [ ] ,
192194 state : existingSpace . state ,
193195 keys : existingSpace . keys ?? [ ] ,
@@ -210,6 +212,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
210212 ...context . spaces ,
211213 {
212214 id : event . spaceId ,
215+ name : event . name ,
213216 events : [ ] ,
214217 state : undefined ,
215218 keys : [ ] ,
@@ -398,6 +401,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
398401 context ,
399402 event : {
400403 spaceId : string ;
404+ name : string ;
401405 updates ?: Updates ;
402406 inboxes ?: SpaceInboxStorageEntry [ ] ;
403407 events : SpaceEvent [ ] ;
@@ -415,6 +419,7 @@ export const store: Store<StoreContext, StoreEvent, GenericEventObject> = create
415419 result . handle . doneLoading ( ) ;
416420
417421 const newSpace : SpaceStorageEntry = {
422+ name : event . name ,
418423 id : event . spaceId ,
419424 events : event . events ,
420425 state : event . spaceState ,
0 commit comments