fix: move loadStatus call to mouseenter handler to prevent re-render loop

This commit is contained in:
vicrodh committed 2026-01-31 23:51:12 -06:00
1 parent ae81b1c3c4
commit eaf250383a
1 file changed
+1 -9
+1 -9
View File
@@ -161,14 +161,6 @@
} }
} }
// Always refresh status when hovering to get fresh device name
// The device name is only set when playback starts, so we need to re-fetch
$effect(() => {
if (isHovering) {
loadStatus();
}
});
// Calculate overflow for ticker animation when tooltip is visible // Calculate overflow for ticker animation when tooltip is visible
$effect(() => { $effect(() => {
if (isHovering && deviceNameRef && deviceNameTextRef) { if (isHovering && deviceNameRef && deviceNameTextRef) {
@@ -212,7 +204,7 @@
class="audio-badges" class="audio-badges"
role="group" role="group"
aria-label="Audio output indicators" aria-label="Audio output indicators"
onmouseenter={() => isHovering = true} onmouseenter={() => { isHovering = true; loadStatus(); }}
onmouseleave={() => isHovering = false} onmouseleave={() => isHovering = false}
> >
<!-- Casting Badge (shown when casting to external device) --> <!-- Casting Badge (shown when casting to external device) -->