Fix issue with location of socket metadata

This commit is contained in:
Andrew Kingston 2023-07-05 09:02:10 +01:00
parent 8f601a2c58
commit aedd04b98a
3 changed files with 10 additions and 6 deletions

View File

@ -127,8 +127,8 @@ export const selectedAutomation = derived(automationStore, $automationStore => {
export const userSelectedResourceMap = derived(userStore, $userStore => { export const userSelectedResourceMap = derived(userStore, $userStore => {
let map = {} let map = {}
$userStore.forEach(user => { $userStore.forEach(user => {
if (user.selectedResourceId) { if (user.builderMetadata?.selectedResourceId) {
map[user.selectedResourceId] = user map[user.builderMetadata?.selectedResourceId] = user
} }
}) })
return map return map

View File

@ -86,8 +86,10 @@ export default class BuilderSocket extends BaseSocket {
async updateUser(socket: Socket, patch: Object) { async updateUser(socket: Socket, patch: Object) {
await super.updateUser(socket, { await super.updateUser(socket, {
...socket.data.builderMetadata, builderMetadata: {
...patch, ...socket.data.builderMetadata,
...patch,
},
}) })
} }

View File

@ -71,8 +71,10 @@ export default class GridSocket extends BaseSocket {
async updateUser(socket: Socket, patch: Object) { async updateUser(socket: Socket, patch: Object) {
await super.updateUser(socket, { await super.updateUser(socket, {
...socket.data.gridMetadata, gridMetadata: {
...patch, ...socket.data.gridMetadata,
...patch,
},
}) })
} }