Skip to content

Commit

Permalink
fix: condition disappears
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Aug 14, 2024
1 parent d281649 commit 014a585
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/view/properties-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class PropertiesEditor extends LitElement {
`)
}
</select>
${ selected.has('conditionOperator') && Object.values(BinariOperator).includes(selected.get('conditionOperator')) ? this.renderStateEditor(selected, 'Condition 2', Properties.condition2, false) : '' }
${ this.renderStateEditor(selected, '', Properties.condition2, false, false, selected.has('conditionOperator') && Object.values(BinariOperator).includes(selected.get('conditionOperator'))) }
</main>
</section>
<section class="ds-section">
Expand All @@ -169,9 +169,10 @@ export class PropertiesEditor extends LitElement {
}
}

renderStateEditor(selected: Component, label: string, name: Properties, publicState: boolean, hideLoopData = false) {
renderStateEditor(selected: Component, label: string, name: Properties, publicState: boolean, hideLoopData = false, visible = true) {
return html`
<state-editor
.style=${visible ? '' : 'display: none;'}
.selected=${selected}
.editor=${this.editor}
id="${name}"
Expand Down Expand Up @@ -202,8 +203,8 @@ export class PropertiesEditor extends LitElement {
stateEditorFinally.data = [getFixedToken(`Error setting data: ${e}`)]
}
this.redrawing = false
// Store the selected component
this.inputs[name]!.selected = selected
// Store the selected component
this.inputs[name]!.selected = selected
}
})}
@change=${() => this.onChange(selected, name, publicState)}
Expand Down

0 comments on commit 014a585

Please sign in to comment.