Skip to content

Commit

Permalink
Fix rendering values
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Apr 26, 2024
1 parent 5bf226b commit 213f37b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function renderValue(value?: any, placeholder: string = 'Value'): HTMLEle

function renderObjectValue(container: HTMLElement, value?: any) {
if (!value) {
container.innerText = '[Empty Value]';
container.innerText = '';
return;
}

Expand Down Expand Up @@ -77,16 +77,16 @@ function renderObjectValue(container: HTMLElement, value?: any) {
}

if (value.Value["string"]) {
console.log(value.Value["string"])
container.innerHTML = value.Value["string"];
return;
}

varName = value.Value.VariableName ?? value.Value.OutputName ?? value.Value.PropertyName;
varType = value.Value.Type;
} else if (value.Variable) {
varName = value.Variable.Value.VariableName;
varType = value.Variable.Value.Type;
const variableValue = value.Variable.Value;
varName = variableValue.VariableName ?? variableValue.OutputName ?? variableValue.PropertyName;
varType = variableValue.Type;
} else if (value.workflowName) {
container.innerText = value.workflowName;
return;
Expand All @@ -95,6 +95,10 @@ function renderObjectValue(container: HTMLElement, value?: any) {
return;
}

if (!varName && varType === 'ExtensionInput') {
varName = "Shortcut Input"
}

container.appendChild(
renderInlineVariable(varName, varType),
);
Expand Down

0 comments on commit 213f37b

Please sign in to comment.