Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/services/SyncServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import { logger } from '../helpers/logger.js'
* @param {object} options.initialSession - initialSession to start from
*/
export default function createSyncServiceProvider({ ydoc, syncService, fileId, initialSession }) {
if (!fileId) {
// We need a file id as a unique identifier for y.js as otherwise state might leak between different files
throw new Error('fileId is required')
}
const WebSocketPolyfill = initWebSocketPolyfill(syncService, fileId, initialSession)
const websocketProvider = new WebsocketProvider(
'ws://localhost:1234',
Expand Down
1 change: 1 addition & 0 deletions src/views/DirectEditing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<div id="direct-editor" :class="{'icon-loading': saving}">
<Editor ref="editor"
:initial-session="initialSession"
:file-id="initial.fileId"
:active="true"
:mime="initial.mimetype"
:is-direct-editing="true"
Expand Down