diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index 8dbee49327..e8fba9a0ee 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -127,8 +127,8 @@ export const selectedAutomation = derived(automationStore, $automationStore => { export const userSelectedResourceMap = derived(userStore, $userStore => { let map = {} $userStore.forEach(user => { - if (user.selectedResourceId) { - map[user.selectedResourceId] = user + if (user.builderMetadata?.selectedResourceId) { + map[user.builderMetadata?.selectedResourceId] = user } }) return map diff --git a/packages/server/src/websockets/builder.ts b/packages/server/src/websockets/builder.ts index 8b40115702..cff42ce178 100644 --- a/packages/server/src/websockets/builder.ts +++ b/packages/server/src/websockets/builder.ts @@ -86,8 +86,10 @@ export default class BuilderSocket extends BaseSocket { async updateUser(socket: Socket, patch: Object) { await super.updateUser(socket, { - ...socket.data.builderMetadata, - ...patch, + builderMetadata: { + ...socket.data.builderMetadata, + ...patch, + }, }) } diff --git a/packages/server/src/websockets/grid.ts b/packages/server/src/websockets/grid.ts index d9e454608b..f95137ee08 100644 --- a/packages/server/src/websockets/grid.ts +++ b/packages/server/src/websockets/grid.ts @@ -71,8 +71,10 @@ export default class GridSocket extends BaseSocket { async updateUser(socket: Socket, patch: Object) { await super.updateUser(socket, { - ...socket.data.gridMetadata, - ...patch, + gridMetadata: { + ...socket.data.gridMetadata, + ...patch, + }, }) }