fix merge more

This commit is contained in:
DD Liu 2017-05-15 10:45:20 -04:00
parent 4cfedc8d9d
commit dcdb806b57
2 changed files with 6 additions and 3 deletions

View file

@ -688,7 +688,10 @@ class Runtime extends EventEmitter {
// @todo: Only render when this.redrawRequested or clones rendered.
this.renderer.draw();
}
if (this._refreshTargets) this.emit(Runtime.TARGETS_UPDATE);
// @todo only emit if monitors has changed since last time.
this.emit(Runtime.MONITORS_UPDATE,
Object.keys(this._monitorState).map(key => this._monitorState[key])
);
}
/**

View file

@ -55,8 +55,8 @@ class VirtualMachine extends EventEmitter {
this.runtime.on(Runtime.TARGETS_UPDATE, () => {
this.emitTargetsUpdate();
});
instance.runtime.on(Runtime.MONITORS_UPDATE, monitorList => {
instance.emit(Runtime.MONITORS_UPDATE, monitorList);
this.runtime.on(Runtime.MONITORS_UPDATE, monitorList => {
this.emit(Runtime.MONITORS_UPDATE, monitorList);
});
this.blockListener = this.blockListener.bind(this);