From 1330d34da3864d85282029b4468d46692c187fb9 Mon Sep 17 00:00:00 2001 From: texuf Date: Fri, 26 Jul 2024 12:49:21 -0700 Subject: [PATCH] Properly initialize channelIds in the space observable (#472) --- packages/sdk/src/sync-agent/spaces/models/space.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/sync-agent/spaces/models/space.ts b/packages/sdk/src/sync-agent/spaces/models/space.ts index 86ccab77d..4d6d7c635 100644 --- a/packages/sdk/src/sync-agent/spaces/models/space.ts +++ b/packages/sdk/src/sync-agent/spaces/models/space.ts @@ -119,7 +119,7 @@ export class Space extends PersistedObservable { 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( @@ -130,7 +130,7 @@ export class Space extends PersistedObservable { ) } } - this.setData({ initialized: true }) + this.setData({ initialized: true, channelIds: channelIds }) } }