Skip to content

Commit

Permalink
Merge pull request #277 from boostcampwm-2024/Feature/#276_순서리스트_null…
Browse files Browse the repository at this point in the history
…나오는_현상

Feature/#276 순서리스트 null나오는 현상
  • Loading branch information
github-actions[bot] authored Dec 2, 2024
2 parents 68034be + 9ae1310 commit bd116d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/src/workspace/workspace.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ export class WorkspaceGateway implements OnGatewayInit, OnGatewayConnection, OnG
pageId: data.pageId,
} as RemoteBlockDeleteOperation;
this.emitOperation(client.id, data.pageId, "delete/block", operation, batch);
currentPage.crdt.LinkedList.updateAllOrderedListIndices();
} catch (error) {
this.logger.error(
`Block Delete 연산 처리 중 오류 발생 - Client ID: ${clientInfo?.clientId}`,
Expand All @@ -657,14 +658,14 @@ export class WorkspaceGateway implements OnGatewayInit, OnGatewayConnection, OnG
`Block Update 연산 수신 - Client ID: ${clientInfo?.clientId}, Data:`,
JSON.stringify(data),
);

console.log(data);
const { workspaceId } = client.data;
const currentPage = await this.workSpaceService.getPage(workspaceId, data.pageId);
if (!currentPage) {
throw new Error(`Page with id ${data.pageId} not found`);
}
currentPage.crdt.remoteUpdate(data.node, data.pageId);

currentPage.crdt.LinkedList.updateAllOrderedListIndices();
const operation = {
type: "blockUpdate",
node: data.node,
Expand Down Expand Up @@ -711,6 +712,7 @@ export class WorkspaceGateway implements OnGatewayInit, OnGatewayConnection, OnG
pageId: data.pageId,
} as RemoteBlockReorderOperation;
this.emitOperation(client.id, data.pageId, "reorder/block", operation, batch);
currentPage.crdt.LinkedList.updateAllOrderedListIndices();
} catch (error) {
this.logger.error(
`Block Reorder 연산 처리 중 오류 발생 - Client ID: ${clientInfo?.clientId}`,
Expand Down

0 comments on commit bd116d3

Please sign in to comment.