Skip to content

Commit

Permalink
upd: socket display prop name
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Nov 10, 2023
1 parent f2d9ddc commit 5a11d85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/northstar/src/blocks/component/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ComponentBlock extends RectBlock {
});

const shouldHideSocket = (socketInfo: { kind: string; name: string }) => {
const prop = this.props[`display ${socketInfo.name}`];
const prop = this.props[`[${socketInfo.name}]`];
return (
(socketInfo.kind === "as-hided-socket" && prop !== true) ||
(socketInfo.kind === "as-hidable-socket" && prop === false)
Expand Down
6 changes: 3 additions & 3 deletions packages/northstar/src/blocks/component/getProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ export function getProps(block: ComponentBlock): PropsData {
.map(
(v) =>
({
name: `display ${v.name}`,
name: `[${v.name}]`,
type: "switch",
getVal: () => {
return (
block.props[`display ${v.name}`] ??
block.props[`[${v.name}]`] ??
v.kind === "as-hidable-socket"
);
},
setVal: (val: any) => {
block.props[`display ${v.name}`] = val;
block.props[`[${v.name}]`] = val;
},
}) as PropData,
),
Expand Down

0 comments on commit 5a11d85

Please sign in to comment.