Skip to content

Commit

Permalink
fix(editor): Fix canvas loading when page gets restored from bfcache (#…
Browse files Browse the repository at this point in the history
…6304)

* fix(editor): Fix canvas loading when page gets restored from bfcache

* Lint fix
  • Loading branch information
OlegIvaniv authored May 23, 2023
1 parent e3a53fd commit 11477f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/editor-ui/src/views/NodeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3777,6 +3777,12 @@ export default defineComponent({
this.disableNodes([node]);
}
},
onPageShow(e: PageTransitionEvent) {
// Page was restored from the bfcache (back-forward cache)
if (e.persisted) {
this.stopLoading();
}
},
},
async mounted() {
this.resetWorkspace();
Expand Down Expand Up @@ -3880,6 +3886,7 @@ export default defineComponent({
document.addEventListener('keydown', this.keyDown);
document.addEventListener('keyup', this.keyUp);
window.addEventListener('message', this.onPostMessageReceived);
window.addEventListener('pageshow', this.onPageShow);
this.$root.$on('newWorkflow', this.newWorkflow);
this.$root.$on('importWorkflowData', this.onImportWorkflowDataEvent);
Expand All @@ -3904,6 +3911,7 @@ export default defineComponent({
document.removeEventListener('keyup', this.keyUp);
window.removeEventListener('message', this.onPostMessageReceived);
window.removeEventListener('beforeunload', this.onBeforeUnload);
window.removeEventListener('pageshow', this.onPageShow);
this.$root.$off('newWorkflow', this.newWorkflow);
this.$root.$off('importWorkflowData', this.onImportWorkflowDataEvent);
Expand Down

0 comments on commit 11477f0

Please sign in to comment.