diff --git a/webapp/src/components/genericComponents/miniStreamDisplay.vue b/webapp/src/components/genericComponents/miniStreamDisplay.vue
index b699ab97..7d5d3abe 100644
--- a/webapp/src/components/genericComponents/miniStreamDisplay.vue
+++ b/webapp/src/components/genericComponents/miniStreamDisplay.vue
@@ -5,7 +5,7 @@
class="stream-display uk-width-1-1 uk-height-1-1 scrollTarget"
>
{
+ // Always update local visibility instantly
this.isVisible = isIntersecting;
+
+ // Clear any previous pending timers to prevent ghost fires
+ clearTimeout(this.observerTimeout);
+
+ if (isIntersecting) {
+ // If it's TRUE, we don't want to wait! Turn the stream on immediately.
+ this.store.addStream(this.streamId);
+ } else {
+ // If it's FALSE, wait 50ms before telling the store.
+ // If a TRUE event fires in the next 50ms (like during a tab switch),
+ // this timeout will be cancelled and the stream will never flicker off!
+ this.observerTimeout = setTimeout(() => {
+ this.store.removeStream(this.streamId);
+ }, 50);
+ }
},
- {
- threshold: 0.0,
- },
+ { threshold: 0.0 },
);
+ this.stopIntersectionObserver = stop;
+ },
+ beforeUnmount() {
+ clearTimeout(this.observerTimeout); // Clean up the timer!
+ if (this.stopIntersectionObserver) {
+ this.stopIntersectionObserver();
+ }
+ this.store.removeStream(this.streamId);
},
};
diff --git a/webapp/src/components/labThingsComponents/actionStatusModal.vue b/webapp/src/components/labThingsComponents/actionStatusModal.vue
index b73f93de..88ea7f42 100644
--- a/webapp/src/components/labThingsComponents/actionStatusModal.vue
+++ b/webapp/src/components/labThingsComponents/actionStatusModal.vue
@@ -2,7 +2,11 @@