File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 11import ICommandMeta from '@secret-agent/core-interfaces/ICommandMeta' ;
2- import { IInteractionGroup } from '@secret-agent/core-interfaces/IInteractions' ;
2+ import { IInteractionGroup , IInteractionGroups } from '@secret-agent/core-interfaces/IInteractions' ;
33import { getKeyboardKey } from '@secret-agent/core-interfaces/IKeyboardLayoutUS' ;
44import getAttachedStateFnName from '@secret-agent/core-interfaces/getAttachedStateFnName' ;
55import ICommandWithResult from '../interfaces/ICommandWithResult' ;
@@ -127,6 +127,21 @@ export default class CommandFormatter {
127127 }
128128 }
129129
130+ if ( ! command . resultNodeIds && command . name === 'execJsPath' ) {
131+ const [ jsPath ] = JSON . parse ( command . args ) ;
132+ if ( typeof jsPath [ 0 ] === 'number' ) command . resultNodeIds = [ jsPath [ 0 ] ] ;
133+ }
134+
135+ if ( ! command . resultNodeIds && command . name === 'interact' ) {
136+ const args = JSON . parse ( command . args ) ;
137+ const mouseInteraction = args . find ( ( x : IInteractionGroup ) => {
138+ return x . length && x [ 0 ] . mousePosition && x [ 0 ] . mousePosition . length === 1 ;
139+ } ) ;
140+ if ( mouseInteraction ) {
141+ command . resultNodeIds = mouseInteraction . mousePosition ;
142+ }
143+ }
144+
130145 // we have shell objects occasionally coming back. hide from ui
131146 if ( meta . args ?. includes ( getAttachedStateFnName ) ) {
132147 command . result = undefined ;
You can’t perform that action at this time.
0 commit comments