Skip to content

Commit

Permalink
feat: leave/page 누락건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyonun321 committed Dec 5, 2024
1 parent 7a2cab8 commit c8cbcfb
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 c8cbcfb

Please sign in to comment.