Skip to content

Commit

Permalink
fix(sync): clear old providers on reconnect
Browse files Browse the repository at this point in the history
avoids the old provider leaking error events.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud authored and backportbot-nextcloud[bot] committed Dec 18, 2023
1 parent 27836bf commit e524f04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ export default {

this.listenSyncServiceEvents()

this.$providers.forEach(p => p?.destroy())
this.$providers = []
const syncServiceProvider = createSyncServiceProvider({
ydoc: this.$ydoc,
syncService: this.$syncService,
Expand Down

0 comments on commit e524f04

Please sign in to comment.