@@ -132,9 +132,8 @@ export function executeGenieCode(command: string): GenieCodeResult {
132
132
return genieDispatch ( async ( ) => {
133
133
console . log ( `before executing state ${ JSON . stringify ( sharedState ) } ` ) ;
134
134
try {
135
- const result = await GenieInterpreter . dslInterpreter . interpretSteps (
136
- command
137
- ) ;
135
+ const result =
136
+ await GenieInterpreter . dslInterpreter . interpretSteps ( command ) ;
138
137
// console.log(`executed result ${result}`);
139
138
return {
140
139
success : true ,
@@ -158,7 +157,7 @@ export function displayResult(
158
157
executionResult : GenieCodeResult ,
159
158
transcript : string ,
160
159
parsed : string ,
161
- genieInterfaces : GenieInterfaceSpec [ ]
160
+ genieInterfaces : GenieInterfaceSpec [ ] ,
162
161
) {
163
162
genieDispatch ( ( ) => {
164
163
let allDisplayingObjects = [ ] ;
@@ -204,7 +203,11 @@ export function displayResult(
204
203
let instantiatedDisplayingObject = null ;
205
204
if ( displayingObject != null ) {
206
205
// if displayingObject is an array
207
- if ( displayingObject instanceof Array ) {
206
+ if (
207
+ displayingObject instanceof Array &&
208
+ displayingObject . length >= 1 &&
209
+ displayingObject [ 0 ] instanceof DataClass
210
+ ) {
208
211
// always display
209
212
onScreen = false ;
210
213
instantiatedDisplayingObject = [ ] ;
@@ -236,8 +239,8 @@ export function displayResult(
236
239
genieInterface . className === Instance . constructor . name &&
237
240
shallowEqual (
238
241
genieInterface . key ,
239
- Instance . _getConstructorParams ( )
240
- )
242
+ Instance . _getConstructorParams ( ) ,
243
+ ) ,
241
244
) ;
242
245
if ( ! targetInterface ) {
243
246
onScreen = false ;
@@ -254,8 +257,8 @@ export function displayResult(
254
257
parsed ,
255
258
stringifyResult (
256
259
// now we only display the last result
257
- executionResult . results [ executionResult . results . length - 1 ] . result
258
- )
260
+ executionResult . results [ executionResult . results . length - 1 ] . result ,
261
+ ) ,
259
262
)
260
263
. then ( ( result ) => {
261
264
console . log ( `respond result: ${ result } ` ) ;
@@ -271,14 +274,14 @@ export function displayResult(
271
274
const reactGenieState = sharedState as ReactGenieState ;
272
275
reactGenieState . navState = {
273
276
objectViewClassName : AllGenieObjectInterfaces . getInterfaces (
274
- instantiatedDisplayingObject
277
+ instantiatedDisplayingObject ,
275
278
) . viewClassName ,
276
279
objectConstructorParams :
277
280
allDisplayingObjects . length === 1
278
281
? allDisplayingObjects [ 0 ] . value . _getConstructorParams ( )
279
282
: {
280
283
elements : allDisplayingObjects . map ( ( displayingObject ) =>
281
- displayingObject . value . _getConstructorParams ( )
284
+ displayingObject . value . _getConstructorParams ( ) ,
282
285
) ,
283
286
} ,
284
287
} ;
0 commit comments