Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#276 순서리스트 null나오는 현상 #277

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions server/src/workspace/workspace.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,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 @@ -656,14 +657,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 @@ -710,6 +711,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
Loading