fix: 🐛 popup modal does not trigger when more than one button on page

This commit is contained in:
Sebin Nyshkim 2025-06-22 01:38:51 +02:00
parent 1e3566bd95
commit cbcac29561

View file

@ -1,7 +1,8 @@
<script>
const nsfwButton = document.querySelector('#nsfw-toggle');
const nsfwButtonBtns = document.querySelectorAll('.nsfw-toggle');
nsfwButton.addEventListener('click', () => {
nsfwButtonBtns.forEach((btn) =>
btn.addEventListener('click', () => {
const isInHornyJail = storeProxy.getItem('isInHornyJail') === 'true';
const isHorny = storeProxy.getItem('isHorny') === 'true';
@ -10,7 +11,8 @@
} else {
open();
}
});
})
);
</script>
<div webc:root="override">
@ -20,7 +22,7 @@
</div>
</div>
<ref-button id="nsfw-toggle" command="show-modal" commandfor="nsfw-warning">
<ref-button class="nsfw-toggle" command="show-modal" commandfor="nsfw-warning">
Reveal/Hide
</ref-button>