Skip to content

Commit b4ca3b7

Browse files
committed
avoid rendering list of HelperClass
1 parent e0a41a4 commit b4ca3b7

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactgenie-lib",
3-
"version": "1.1.49",
3+
"version": "1.1.50",
44
"description": "A Toolkit for Multimodal Applications",
55
"author": "valkjsaaa",
66
"license": "Apache-2.0",

src/shared-store.ts

+14-11
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ export function executeGenieCode(command: string): GenieCodeResult {
132132
return genieDispatch(async () => {
133133
console.log(`before executing state ${JSON.stringify(sharedState)}`);
134134
try {
135-
const result = await GenieInterpreter.dslInterpreter.interpretSteps(
136-
command
137-
);
135+
const result =
136+
await GenieInterpreter.dslInterpreter.interpretSteps(command);
138137
// console.log(`executed result ${result}`);
139138
return {
140139
success: true,
@@ -158,7 +157,7 @@ export function displayResult(
158157
executionResult: GenieCodeResult,
159158
transcript: string,
160159
parsed: string,
161-
genieInterfaces: GenieInterfaceSpec[]
160+
genieInterfaces: GenieInterfaceSpec[],
162161
) {
163162
genieDispatch(() => {
164163
let allDisplayingObjects = [];
@@ -204,7 +203,11 @@ export function displayResult(
204203
let instantiatedDisplayingObject = null;
205204
if (displayingObject != null) {
206205
// 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+
) {
208211
// always display
209212
onScreen = false;
210213
instantiatedDisplayingObject = [];
@@ -236,8 +239,8 @@ export function displayResult(
236239
genieInterface.className === Instance.constructor.name &&
237240
shallowEqual(
238241
genieInterface.key,
239-
Instance._getConstructorParams()
240-
)
242+
Instance._getConstructorParams(),
243+
),
241244
);
242245
if (!targetInterface) {
243246
onScreen = false;
@@ -254,8 +257,8 @@ export function displayResult(
254257
parsed,
255258
stringifyResult(
256259
// 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+
),
259262
)
260263
.then((result) => {
261264
console.log(`respond result: ${result}`);
@@ -271,14 +274,14 @@ export function displayResult(
271274
const reactGenieState = sharedState as ReactGenieState;
272275
reactGenieState.navState = {
273276
objectViewClassName: AllGenieObjectInterfaces.getInterfaces(
274-
instantiatedDisplayingObject
277+
instantiatedDisplayingObject,
275278
).viewClassName,
276279
objectConstructorParams:
277280
allDisplayingObjects.length === 1
278281
? allDisplayingObjects[0].value._getConstructorParams()
279282
: {
280283
elements: allDisplayingObjects.map((displayingObject) =>
281-
displayingObject.value._getConstructorParams()
284+
displayingObject.value._getConstructorParams(),
282285
),
283286
},
284287
};

0 commit comments

Comments
 (0)