Skip to content

Commit

Permalink
Improve and fix variable reference rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Nov 20, 2023
1 parent f0228ab commit 575e480
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,31 @@ function renderObjectValue(container: HTMLElement, value?: any) {
const inlineVar = renderInlineVariable(variable.VariableName);
str = str.replace('\uFFFC', inlineVar.outerHTML);
} else {
let globalName = variable.VariableName;
let globalIcon = 'globe';
let varTypeName = variable.OutputName;
let icon = 'globe';
if (variable.Aggrandizements) {
globalName = variable.Aggrandizements[0].PropertyName;
varTypeName = variable.Aggrandizements[0].PropertyName;
}
switch (variable.Type) {
case 'DeviceDetails':
globalIcon = 'desktopcomputer';
icon = 'desktopcomputer';
break;
case 'ActionOutput':
icon = 'wand_stars';
}
const inlineVar = renderInlineVariable(globalName, globalIcon);
const inlineVar = renderInlineVariable(varTypeName, icon);
str = str.replace('\uFFFC', inlineVar.outerHTML);
}
}
container.innerHTML = str;
} else if (value && value.Value) {
if (value.Value.OutputName) {
let char;
let icon;
switch (value.Value.Type) {
case 'ActionOutput':
char = 'wand_stars';
icon = 'wand_stars';
}
const inlineVar = renderInlineVariable(value.Value.OutputName, char);
const inlineVar = renderInlineVariable(value.Value.OutputName, icon);
container.appendChild(inlineVar);
} else {
let char;
Expand Down

0 comments on commit 575e480

Please sign in to comment.