mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Set visible: false instead of deleting state in requestRemoveMonitor
This potentially has performance implications, to be investigated later.
This commit is contained in:
parent
0d0543810f
commit
77dda04228
1 changed files with 7 additions and 1 deletions
|
@ -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})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue