mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(editor): Fix canvas loading when page gets restored from bfcache (#6304)
* fix(editor): Fix canvas loading when page gets restored from bfcache * Lint fix
This commit is contained in:
parent
e3a53fd19d
commit
11477f0a20
|
@ -3777,6 +3777,12 @@ export default defineComponent({
|
||||||
this.disableNodes([node]);
|
this.disableNodes([node]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onPageShow(e: PageTransitionEvent) {
|
||||||
|
// Page was restored from the bfcache (back-forward cache)
|
||||||
|
if (e.persisted) {
|
||||||
|
this.stopLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.resetWorkspace();
|
this.resetWorkspace();
|
||||||
|
@ -3880,6 +3886,7 @@ export default defineComponent({
|
||||||
document.addEventListener('keydown', this.keyDown);
|
document.addEventListener('keydown', this.keyDown);
|
||||||
document.addEventListener('keyup', this.keyUp);
|
document.addEventListener('keyup', this.keyUp);
|
||||||
window.addEventListener('message', this.onPostMessageReceived);
|
window.addEventListener('message', this.onPostMessageReceived);
|
||||||
|
window.addEventListener('pageshow', this.onPageShow);
|
||||||
|
|
||||||
this.$root.$on('newWorkflow', this.newWorkflow);
|
this.$root.$on('newWorkflow', this.newWorkflow);
|
||||||
this.$root.$on('importWorkflowData', this.onImportWorkflowDataEvent);
|
this.$root.$on('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||||
|
@ -3904,6 +3911,7 @@ export default defineComponent({
|
||||||
document.removeEventListener('keyup', this.keyUp);
|
document.removeEventListener('keyup', this.keyUp);
|
||||||
window.removeEventListener('message', this.onPostMessageReceived);
|
window.removeEventListener('message', this.onPostMessageReceived);
|
||||||
window.removeEventListener('beforeunload', this.onBeforeUnload);
|
window.removeEventListener('beforeunload', this.onBeforeUnload);
|
||||||
|
window.removeEventListener('pageshow', this.onPageShow);
|
||||||
|
|
||||||
this.$root.$off('newWorkflow', this.newWorkflow);
|
this.$root.$off('newWorkflow', this.newWorkflow);
|
||||||
this.$root.$off('importWorkflowData', this.onImportWorkflowDataEvent);
|
this.$root.$off('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||||
|
|
Loading…
Reference in a new issue