From 229d5b9533ebced373f45d5a22c16be2d78e43b9 Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Wed, 15 Jul 2020 15:00:04 -0500 Subject: [PATCH] unregister action on destroy --- .../panels/InteractiveEditor/InteractiveEditorControl.js | 1 + .../widgets/InteractiveEditor/InteractiveEditorWidget.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/visualizers/panels/InteractiveEditor/InteractiveEditorControl.js b/src/visualizers/panels/InteractiveEditor/InteractiveEditorControl.js index 35152239d..fdb4039f3 100644 --- a/src/visualizers/panels/InteractiveEditor/InteractiveEditorControl.js +++ b/src/visualizers/panels/InteractiveEditor/InteractiveEditorControl.js @@ -179,6 +179,7 @@ define([ /* * * * * * * * Visualizer life cycle callbacks * * * * * * * */ destroy () { this._detachClientEventListeners(); + this._widget.destroy(); } _attachClientEventListeners () { diff --git a/src/visualizers/widgets/InteractiveEditor/InteractiveEditorWidget.js b/src/visualizers/widgets/InteractiveEditor/InteractiveEditorWidget.js index e2fbca2ae..697008c79 100644 --- a/src/visualizers/widgets/InteractiveEditor/InteractiveEditorWidget.js +++ b/src/visualizers/widgets/InteractiveEditor/InteractiveEditorWidget.js @@ -93,6 +93,13 @@ define([ async createInteractiveSession(computeId, config) { this.session = await Session.new(computeId, config); } + + destroy() { + const features = this.getCapabilities(); + if (features.save) { + DeepForge.unregisterAction('Save'); + } + } } return InteractiveEditorWidget;