From 77dda04228f4361aea076989ac31ed80f7aacac9 Mon Sep 17 00:00:00 2001 From: Connor Hudson Date: Wed, 6 Jun 2018 17:14:09 -0400 Subject: [PATCH] Set visible: false instead of deleting state in requestRemoveMonitor This potentially has performance implications, to be investigated later. --- src/engine/runtime.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 5562ed9db..cdfa8be5e 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -1561,7 +1561,13 @@ class Runtime extends EventEmitter { * @param {!string} monitorId ID of the monitor to remove. */ requestRemoveMonitor (monitorId) { - this._monitorState = this._monitorState.delete(monitorId); + // this._monitorState = this._monitorState.delete(monitorId); + // TODO is this performant? + if (this._monitorState.has(monitorId)) { + this._monitorState = this._monitorState.set( + monitorId, this._monitorState.get(monitorId).merge({visible: false}) + ); + } } /**