From dc7cc49410a96cff7bb23d56556a49cffbf89474 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 1 Nov 2024 15:38:18 +0000 Subject: [PATCH] Fix multiplayer collab for data --- packages/server/src/websockets/grid.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/websockets/grid.ts b/packages/server/src/websockets/grid.ts index a36413454e..3911313cc3 100644 --- a/packages/server/src/websockets/grid.ts +++ b/packages/server/src/websockets/grid.ts @@ -80,7 +80,8 @@ export default class GridSocket extends BaseSocket { } emitRowUpdate(ctx: any, row: Row) { - const resourceId = ctx.params?.viewId || getSourceId(ctx) + const source = getSourceId(ctx) + const resourceId = source.viewId ?? source.tableId const room = `${ctx.appId}-${resourceId}` this.emitToRoom(ctx, room, GridSocketEvent.RowChange, { id: row._id, @@ -89,7 +90,8 @@ export default class GridSocket extends BaseSocket { } emitRowDeletion(ctx: any, row: Row) { - const resourceId = ctx.params?.viewId || getSourceId(ctx) + const source = getSourceId(ctx) + const resourceId = source.viewId ?? source.tableId const room = `${ctx.appId}-${resourceId}` this.emitToRoom(ctx, room, GridSocketEvent.RowChange, { id: row._id,