Skip to content

Commit

Permalink
retrict updates of links to the one with empty link (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbarbe authored Sep 29, 2023
1 parent 46ccb34 commit 8081a14
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions blocks/products/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,13 @@ export default function decorate(block) {

renderNanoBlocks(col, mv);

// listen to ProductCard change and update the first button accordingly
// listen to ProductCard change and update the buttons pointing to the store url
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 === 'https://www.bitdefender.com/site/Store/buy/') {
link.href = card.url;
}
});
});
});
row.remove();
Expand Down

0 comments on commit 8081a14

Please sign in to comment.