🐛(frontend) fix bug multi ws connection
In collaborative mode, only the first document connected was being shared. This was due to the fact that the webrtc server was managing only one connection at a time. This commit fixes this bug by managing multiple connections.
This commit is contained in:
@@ -24,7 +24,9 @@ const initialState = {
|
||||
export const usePadStore = create<PadStore>((set) => ({
|
||||
padsStore: initialState.padsStore,
|
||||
createProvider: (padId: string, initialDoc: Base64) => {
|
||||
const doc = new Y.Doc();
|
||||
const doc = new Y.Doc({
|
||||
guid: padId,
|
||||
});
|
||||
|
||||
if (initialDoc) {
|
||||
Y.applyUpdate(doc, Buffer.from(initialDoc, 'base64'));
|
||||
|
||||
Reference in New Issue
Block a user