Skip to content

Commit

Permalink
Merge pull request #307 from boostcampwm-2024/Feature/#306_leave/page…
Browse files Browse the repository at this point in the history
…_누락_추가

Feature/#306 leave/page 누락건 추가
  • Loading branch information
github-actions[bot] authored Dec 5, 2024
2 parents 7a2cab8 + c8cbcfb commit 374a7a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/src/features/workSpace/hooks/usePagesManage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
import { Page as CRDTPage } from "@noctaCrdt/Page";
import { WorkSpace } from "@noctaCrdt/WorkSpace";
import { useEffect, useState, useRef, useCallback } from "react";
import { PAGE, SIDE_BAR } from "@src/constants/size";
import { useSocketStore } from "@src/stores/useSocketStore";
import { useToastStore } from "@src/stores/useToastStore";
import { Page } from "@src/types/page";
import { PAGE, SIDE_BAR } from "@src/constants/size";

const PAGE_OFFSET = 60;

Expand Down Expand Up @@ -242,6 +242,11 @@ export const usePagesManage = (workspace: WorkSpace | null, clientId: number | n
page.id === pageId ? { ...page, isVisible: false, isLoaded: false } : page,
),
);
// Socket.IO를 통해 서버에 페이지 퇴장 알림
const socketStore = useSocketStore.getState();
if (socketStore.socket) {
socketStore.socket.emit("leave/page", { pageId });
}
};
const updatePage = (
pageId: string,
Expand Down

0 comments on commit 374a7a0

Please sign in to comment.