Set visible: false instead of deleting state in requestRemoveMonitor

This potentially has performance implications, to be investigated later.
This commit is contained in:
Connor Hudson 2018-06-06 17:14:09 -04:00
parent 0d0543810f
commit 77dda04228

View file

@ -1561,7 +1561,13 @@ class Runtime extends EventEmitter {
* @param {!string} monitorId ID of the monitor to remove. * @param {!string} monitorId ID of the monitor to remove.
*/ */
requestRemoveMonitor (monitorId) { 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})
);
}
} }
/** /**