Skip to content

Commit

Permalink
Remove color picker event listener when threshold tab is unmounted
Browse files Browse the repository at this point in the history
should occur when the dashboard is left because all pipeline config tabs are kept alive to persist changing settings and state
  • Loading branch information
srimanachanta committed Jul 20, 2023
1 parent f613dc4 commit 623a8f6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
import { computed, getCurrentInstance, onMounted } from "vue";
import { computed, getCurrentInstance, onBeforeUnmount, onMounted } from "vue";
import CvRangeSlider from "@/components/common/cv-range-slider.vue";
import CvSwitch from "@/components/common/cv-switch.vue";
import { useStateStore } from "@/stores/StateStore";
Expand Down Expand Up @@ -101,6 +101,12 @@ onMounted(() => {
cameraStream.addEventListener("click", handleStreamClick);
});
onBeforeUnmount(() => {
const cameraStream = document.getElementById("input-camera-stream");
if(cameraStream === null) return;
cameraStream.removeEventListener("click", handleStreamClick);
});
const interactiveCols = computed(() => (getCurrentInstance()?.proxy.$vuetify.breakpoint.mdAndDown || false) && (!useStateStore().sidebarFolded || useCameraSettingsStore().isDriverMode)) ? 9 : 8;
</script>
Expand Down

0 comments on commit 623a8f6

Please sign in to comment.