Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #505 from brandonbk/set-with-section-two
Browse files Browse the repository at this point in the history
Update setWithSection logic
  • Loading branch information
brandonbk authored Dec 5, 2022
2 parents 26d6ca5 + 44a846b commit b51a0b1
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ $ const withSection = defaultValue(input.withSection, true);
$ const { nativeX: nxConfig } = out.global;
$ const nativeX = getAsObject(input, "nativeX");
$ const withNativeXSection = defaultValue(input.withNativeXSection, true);
$ const setWithSection = (node, nxNode, withNativeXSection = true) => {
if (node.withSection) return true;
if (!withNativeXSection) return false
$ const setWithSection = (node, nxNode, withNativeXSection = true, nodeInput = {}) => {
if (nodeInput.withSection) return true;
if (!withNativeXSection) return false;
return node.id !== nxNode.id;
};
Expand Down Expand Up @@ -54,8 +54,9 @@ $ const setWithSection = (node, nxNode, withNativeXSection = true) => {
config=nxConfig
>
<theme-section-feed-content-node
...input.node
display-image=input.displayImage
with-section=setWithSection(node, nxNode, withNativeXSection)
with-section=setWithSection(node, nxNode, withNativeXSection, input.node)
lazyload=lazyload
node=nxNode
attrs=containerAttrs
Expand All @@ -65,9 +66,10 @@ $ const setWithSection = (node, nxNode, withNativeXSection = true) => {
</if>
<else>
<theme-section-feed-content-node
with-section=withSection
...input.node
node=node
display-image=input.displayImage
with-section=withSection
lazyload=lazyload
/>
</else>
Expand Down

0 comments on commit b51a0b1

Please sign in to comment.