diff --git a/src/backend/agent.js b/src/backend/agent.js index 39a1f38381..dee69506cb 100644 --- a/src/backend/agent.js +++ b/src/backend/agent.js @@ -29,11 +29,6 @@ const debug = (methodName, ...args) => { } }; -type OperationsParams = {| - operations: Uint32Array, - rendererID: number, -|}; - type InspectSelectParams = {| id: number, rendererID: number, @@ -505,7 +500,7 @@ export default class Agent extends EventEmitter { } }; - onHookOperations = ({ operations, rendererID }: OperationsParams) => { + onHookOperations = (operations: Uint32Array) => { if (__DEBUG__) { debug('onHookOperations', operations); } @@ -533,6 +528,7 @@ export default class Agent extends EventEmitter { this._bridge.send('operations', operations); if (this._persistedSelection !== null) { + const rendererID = operations[0]; if (this._persistedSelection.rendererID === rendererID) { // Check if we can select a deeper match for the persisted selection. const renderer = this._rendererInterfaces[rendererID]; diff --git a/src/backend/renderer.js b/src/backend/renderer.js index 9d751756ae..f83dfcc6f9 100644 --- a/src/backend/renderer.js +++ b/src/backend/renderer.js @@ -686,10 +686,7 @@ export function attach( pendingOperationsQueue.push(ops); } else { // If we've already connected to the frontend, just pass the operations through. - hook.emit('operations', { - operations: ops, - rendererID, - }); + hook.emit('operations', ops); } pendingOperations.length = 0; @@ -1155,10 +1152,7 @@ export function attach( // We may have already queued up some operations before the frontend connected // If so, let the frontend know about them. localPendingOperationsQueue.forEach(ops => { - hook.emit('operations', { - operations: ops, - rendererID, - }); + hook.emit('operations', ops); }); } else { // Before the traversals, remember to start tracking