Skip to content

Commit

Permalink
fix: name예외처리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyonun321 committed Dec 4, 2024
1 parent 9674b89 commit 01a6896
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/src/workspace/workspace.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,13 @@ export class WorkspaceGateway implements OnGatewayInit, OnGatewayConnection, OnG
const workspaces = await this.workSpaceService.getUserWorkspaces(userId);
const userInfo = await this.authService.getProfile(userId);
let NewWorkspaceId = "";

if (userId === "guest") {
client.join("guest");
NewWorkspaceId = "guest";
} else if (workspaces.length === 0) {
const workspace = await this.workSpaceService.createWorkspace(
userId,
`${userInfo.name}의 Workspace`,
`${userInfo === null ? "guest" : userInfo.name}의 Workspace`,
);
client.join(workspace.id);
NewWorkspaceId = workspace.id;
Expand Down Expand Up @@ -176,7 +175,7 @@ export class WorkspaceGateway implements OnGatewayInit, OnGatewayConnection, OnG
};
});

this.logger.log(`Sending workspace list to client ${client.id}`);
this.logger.log(`Sending workspace list to client(user.id): ${client.data.userId}`);
client.emit("workspace/list", workspaceList);
this.SocketStoreBroadcastWorkspaceConnections();
}, 100);
Expand Down Expand Up @@ -454,6 +453,7 @@ export class WorkspaceGateway implements OnGatewayInit, OnGatewayConnection, OnG
page: newPage.serialize(),
} as RemotePageCreateOperation;
client.emit("create/page", operation);

this.emitOperation(client.id, workspaceId, "create/page", operation, batch);
} catch (error) {
this.logger.error(
Expand Down Expand Up @@ -658,7 +658,6 @@ 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) {
Expand Down

0 comments on commit 01a6896

Please sign in to comment.