Update websocket user metadata structures
This commit is contained in:
parent
d80cca9a11
commit
4725faf8b5
|
@ -30,8 +30,9 @@ export const deriveStores = context => {
|
|||
([$users, $focusedCellId]) => {
|
||||
let map = {}
|
||||
$users.forEach(user => {
|
||||
if (user.focusedCellId && user.focusedCellId !== $focusedCellId) {
|
||||
map[user.focusedCellId] = user
|
||||
const cellId = user.gridMetadata?.focusedCellId
|
||||
if (cellId && cellId !== $focusedCellId) {
|
||||
map[cellId] = user
|
||||
}
|
||||
})
|
||||
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) {
|
||||
this.emitToRoom(ctx, ctx.appId, BuilderSocketEvent.TableChange, {
|
||||
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) {
|
||||
const tableId = getTableId(ctx)
|
||||
const room = `${ctx.appId}-${tableId}`
|
||||
|
|
Loading…
Reference in New Issue