Skip to content

Commit

Permalink
Properly initialize channelIds in the space observable (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
texuf authored Jul 26, 2024
1 parent 4b5acea commit 1330d34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sdk/src/sync-agent/spaces/models/space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class Space extends PersistedObservable<SpaceModel> {
if (this.data.id === streamId) {
const stream = this.riverConnection.client?.stream(streamId)
check(isDefined(stream), 'stream is not defined')
const channelIds = stream.view.spaceContent.spaceChannelsMetadata.keys()
const channelIds = [...stream.view.spaceContent.spaceChannelsMetadata.keys()]
for (const channelId of channelIds) {
if (!this.channels[channelId]) {
this.channels[channelId] = new Channel(
Expand All @@ -130,7 +130,7 @@ export class Space extends PersistedObservable<SpaceModel> {
)
}
}
this.setData({ initialized: true })
this.setData({ initialized: true, channelIds: channelIds })
}
}

Expand Down

0 comments on commit 1330d34

Please sign in to comment.