diff --git a/client/src/hooks/useConference.tsx b/client/src/hooks/useConference.tsx index 6295524..9582fc7 100644 --- a/client/src/hooks/useConference.tsx +++ b/client/src/hooks/useConference.tsx @@ -3,7 +3,13 @@ import { WebrtcProvider, } from 'y-webrtc' import { useEffect, useRef, useState } from 'react' import { uuidV4 } from '../util/uuid'; -const uuid = uuidV4(); +const UUIDKey = 'conference-uuid'; +let uuid = localStorage.getItem(UUIDKey); + +if (!uuid) { + uuid = uuidV4(); + localStorage.setItem(UUIDKey, uuid); +} export function useConference() { const docRef = useRef(new Y.Doc());