Skip to content

Commit

Permalink
Make sure showCallToActions is not removed from keys when it is false
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaandotcom committed Dec 20, 2023
1 parent bdd33f9 commit 82efa22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@

<MovingGradient
class="max-w-6xl mt-10 mx-auto text-center"
v-if="article.showCallToActions"
v-if="article.showCallToActions !== false"
>
<h2
class="text-xl md:text-3xl font-bold leading-loose md:leading-loose text-white dark:text-gray-100"
Expand Down
3 changes: 2 additions & 1 deletion utils/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export default ({ data, locale = "en", keys = [], limit }) => {
const filterAttributes = (attributes) => {
const filtered = {};
keys.forEach((key) => {
if (attributes[key]) filtered[key] = attributes[key];
if (typeof attributes[key] !== "undefined" && attributes[key] !== null)
filtered[key] = attributes[key];
});
return filtered;
};
Expand Down

0 comments on commit 82efa22

Please sign in to comment.