refactor(editor): Migrate pushConnection mixin to composable and remove collaboration store side effects (no-changelog) (#9249)

This commit is contained in:
Alex Grozav
2024-05-03 10:26:15 +03:00
committed by GitHub
parent 0a2de093c0
commit ff0955c995
13 changed files with 879 additions and 710 deletions

View File

@@ -806,6 +806,7 @@ export default defineComponent({
this.resetWorkspace();
this.canvasStore.initInstance(this.nodeViewRef as HTMLElement);
this.titleReset();
window.addEventListener('message', this.onPostMessageReceived);
this.clipboard.onPaste.value = this.onClipboardPasteEvent;
@@ -980,6 +981,7 @@ export default defineComponent({
if (!this.isDemo) {
this.pushStore.pushConnect();
}
this.collaborationStore.initialize();
},
beforeUnmount() {
// Make sure the event listeners get removed again else we
@@ -993,6 +995,7 @@ export default defineComponent({
if (!this.isDemo) {
this.pushStore.pushDisconnect();
}
this.collaborationStore.terminate();
this.resetWorkspace();
this.instance.unbind();