Skip to content

Commit

Permalink
retrict updates of links to the one with empty link
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbarbe committed Sep 27, 2023
1 parent 4bca842 commit a5cd91e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions blocks/products/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,11 @@ export default function decorate(block) {

// listen to ProductCard change and update the first button accordingly
mv.subscribe((card) => {
const link = col.querySelector('.button-container a');
if (link) {
link.href = card.url;
}
col.querySelectorAll('.button-container a').forEach((link) => {
if (link && link.href === 'http://') {
link.href = card.url;
}
});
});
});
row.remove();
Expand Down

0 comments on commit a5cd91e

Please sign in to comment.