Update websocket user metadata structures
This commit is contained in:
parent
d80cca9a11
commit
4725faf8b5
|
@ -30,8 +30,9 @@ export const deriveStores = context => {
|
||||||
([$users, $focusedCellId]) => {
|
([$users, $focusedCellId]) => {
|
||||||
let map = {}
|
let map = {}
|
||||||
$users.forEach(user => {
|
$users.forEach(user => {
|
||||||
if (user.focusedCellId && user.focusedCellId !== $focusedCellId) {
|
const cellId = user.gridMetadata?.focusedCellId
|
||||||
map[user.focusedCellId] = user
|
if (cellId && cellId !== $focusedCellId) {
|
||||||
|
map[cellId] = user
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return map
|
return map
|
||||||
|
|
|
@ -78,6 +78,13 @@ export default class BuilderSocket extends BaseSocket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateUser(socket: Socket, patch: Object) {
|
||||||
|
await super.updateUser(socket, {
|
||||||
|
...socket.data.builderMetadata,
|
||||||
|
...patch,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
emitTableUpdate(ctx: any, table: Table) {
|
emitTableUpdate(ctx: any, table: Table) {
|
||||||
this.emitToRoom(ctx, ctx.appId, BuilderSocketEvent.TableChange, {
|
this.emitToRoom(ctx, ctx.appId, BuilderSocketEvent.TableChange, {
|
||||||
id: table._id,
|
id: table._id,
|
||||||
|
|
|
@ -69,6 +69,13 @@ export default class GridSocket extends BaseSocket {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateUser(socket: Socket, patch: Object) {
|
||||||
|
await super.updateUser(socket, {
|
||||||
|
...socket.data.gridMetadata,
|
||||||
|
...patch,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
emitRowUpdate(ctx: any, row: Row) {
|
emitRowUpdate(ctx: any, row: Row) {
|
||||||
const tableId = getTableId(ctx)
|
const tableId = getTableId(ctx)
|
||||||
const room = `${ctx.appId}-${tableId}`
|
const room = `${ctx.appId}-${tableId}`
|
||||||
|
|
Loading…
Reference in New Issue