From 6d033af61edfc4a402b442e18426b1810f86e338 Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Mon, 26 Nov 2018 13:41:23 -0500 Subject: [PATCH] When clearing the runtime, emit has cloud data update. --- src/engine/runtime.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 690ef4a1c..d2eca46ae 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1540,6 +1540,16 @@ class Runtime extends EventEmitter { this.targets.map(this.disposeTarget, this); this._monitorState = OrderedMap({}); // @todo clear out extensions? turboMode? etc. + + // *********** Cloud ******************* + + // If the runtime currently has cloud data, + // emit a has cloud data update event resetting + // it to false + if (this.hasCloudData()) { + this.emit(Runtime.HAS_CLOUD_DATA_UPDATE, false); + } + this.ioDevices.cloud.clear(); // Reset runtime cloud data info @@ -1548,7 +1558,6 @@ class Runtime extends EventEmitter { this.canAddCloudVariable = newCloudDataManager.canAddCloudVariable; this.addCloudVariable = this._initializeAddCloudVariable(newCloudDataManager); this.removeCloudVariable = this._initializeRemoveCloudVariable(newCloudDataManager); - } /**