File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/renderer/src/components/views Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,22 @@ const interactiveUiJsonIssues = vue.ref<locApi.IIssue[]>(
223223);
224224const interactiveInstanceIssues = vue .ref <locApi .IIssue []>([]);
225225const interactiveInputValues = vue .ref <number []>(
226- interactiveModeAvailable .value ? props .uiJson .input .map ((input : locApi .IUiJsonInput ) => input .defaultValue ) : []
226+ interactiveModeAvailable .value
227+ ? props .uiJson .input .map ((input : locApi .IUiJsonInput ) => {
228+ // If the input has some possible values then we want to return the index of the possible value that matches the
229+ // default value otherwise we just return the default value.
230+
231+ if (input .possibleValues !== undefined ) {
232+ for (let i = 0 ; i < input .possibleValues .length ; ++ i ) {
233+ if (input .possibleValues [i ].value === input .defaultValue ) {
234+ return i ;
235+ }
236+ }
237+ }
238+
239+ return input .defaultValue ;
240+ })
241+ : []
227242);
228243const interactiveShowInput = vue .ref <string []>(
229244 interactiveModeAvailable .value ? props .uiJson .input .map ((input : locApi .IUiJsonInput ) => input .visible ?? ' true' ) : []
You can’t perform that action at this time.
0 commit comments