Similar Artists orb: inline onclick (like Amazon) so the click reliably fires

The addEventListener wiring evidently wasn't firing the toggle (orb showed
running but clicking didn't pause). Switched the button back to an inline
onclick=toggleSimilarArtistsEnrichment() — identical to the Amazon orb, which
works — and exposed the fn on window so the inline handler always resolves.
Toggle logic unchanged (active ? pause : resume).
This commit is contained in:
BoulderBadgeDad 2026-06-03 15:59:23 -07:00
parent 940afbf4b2
commit b79b26b7c5
2 changed files with 7 additions and 4 deletions

View file

@ -567,7 +567,8 @@
</div>
<!-- Similar Artists (MusicMap) Enrichment Status Icon -->
<div class="similar-artists-enrich-button-container">
<button class="similar-artists-enrich-button" id="similar-artists-enrich-button" title="Similar Artists (MusicMap) Enrichment">
<button class="similar-artists-enrich-button" id="similar-artists-enrich-button" title="Similar Artists (MusicMap) Enrichment"
onclick="toggleSimilarArtistsEnrichment()">
<img src="https://www.music-map.com/elements/objects/og_logo.png"
alt="Similar Artists" class="similar-artists-enrich-logo">
<div class="similar-artists-enrich-spinner"></div>

View file

@ -1377,10 +1377,10 @@ async function toggleSimilarArtistsEnrichment() {
}
(function _wireSimilarArtistsBubble() {
// Click is the inline onclick on the button (like Amazon) — we only need to
// kick off + poll the status here.
const wire = () => {
const button = document.getElementById('similar-artists-enrich-button');
if (button) {
button.addEventListener('click', toggleSimilarArtistsEnrichment); // standard wiring (like spotify/itunes)
if (document.getElementById('similar-artists-enrich-button')) {
updateSimilarArtistsEnrichmentStatus();
setInterval(updateSimilarArtistsEnrichmentStatus, 2000);
}
@ -1389,6 +1389,8 @@ async function toggleSimilarArtistsEnrichment() {
else wire();
})();
window.toggleSimilarArtistsEnrichment = toggleSimilarArtistsEnrichment; // ensure inline onclick can resolve it
// ===================================================================
// HYDRABASE P2P MIRROR WORKER
// ===================================================================