Skip to content

Commit

Permalink
fix: space connection error가 route가 바뀌어도 유지되던 문제 수정 (#168)
Browse files Browse the repository at this point in the history
fix: space connection error가 route가 바뀌어도 유지되던 문제 수정
  • Loading branch information
hoqn authored Nov 28, 2024
1 parent e0f5b98 commit bfb42be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/frontend/src/hooks/yjs/useYjsConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { generateUserColor } from "@/lib/utils";
export default function useYjsConnection(docName: string) {
const [status, setStatus] = useState<
"connecting" | "connected" | "disconnected"
>("connecting");
>("disconnected");
const [error, setError] = useState<Error>();
const [yDoc, setYDoc] = useState<Y.Doc>();
const [yProvider, setYProvider] = useState<Y.AbstractConnector>();
Expand Down Expand Up @@ -52,6 +52,8 @@ export default function useYjsConnection(docName: string) {
}
setYDoc(undefined);
setYProvider(undefined);
setError(undefined);
setStatus("disconnected");
};
}, [docName]);

Expand Down

0 comments on commit bfb42be

Please sign in to comment.