Fix camera setup modal not closing and navigation not working (#1979)

This commit is contained in:
Gold856
2025-06-29 00:18:54 -04:00
committed by GitHub
parent a9c26202a0
commit cc7923eeb4
3 changed files with 26 additions and 23 deletions

View File

@@ -1,12 +1,11 @@
<script setup lang="ts">
import { computed } from "vue";
import { computed, ref } from "vue";
import CamerasCard from "@/components/dashboard/CamerasCard.vue";
import CameraAndPipelineSelectCard from "@/components/dashboard/CameraAndPipelineSelectCard.vue";
import StreamConfigCard from "@/components/dashboard/StreamConfigCard.vue";
import PipelineConfigCard from "@/components/dashboard/ConfigOptions.vue";
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
import { useStateStore } from "@/stores/StateStore";
import { PlaceholderCameraSettings } from "@/types/SettingTypes";
const cameraViewType = computed<number[]>({
get: (): number[] => {
@@ -39,14 +38,6 @@ const cameraViewType = computed<number[]>({
}
});
// TODO - deduplicate with needsCamerasConfigured
const warningShown = computed<boolean>(() => {
return (
Object.values(useCameraSettingsStore().cameras).length === 0 ||
PlaceholderCameraSettings.nickname === useCameraSettingsStore().currentCameraName
);
});
const arducamWarningShown = computed<boolean>(() => {
return Object.values(useCameraSettingsStore().cameras).some(
(c) =>
@@ -58,6 +49,8 @@ const arducamWarningShown = computed<boolean>(() => {
)
);
});
const showCameraSetupDialog = ref(useCameraSettingsStore().needsCameraConfiguration);
</script>
<template>
@@ -87,11 +80,17 @@ const arducamWarningShown = computed<boolean>(() => {
<PipelineConfigCard />
<!-- TODO - not sure this belongs here -->
<v-dialog v-if="warningShown" v-model="warningShown" :persistent="false" max-width="800" dark>
<v-dialog
v-if="useCameraSettingsStore().needsCameraConfiguration"
v-model="showCameraSetupDialog"
max-width="800"
dark
>
<v-card flat color="primary">
<v-card-title>Setup some cameras to get started!</v-card-title>
<v-card-text>
No cameras activated - head to the <a href="#/cameraConfigs">Camera matching tab</a> to set some up!
No cameras activated - head to the <router-link to="/cameraConfigs">Camera matching tab</router-link> to set
some up!
</v-card-text>
</v-card>
</v-dialog>