Skip to content

Commit cc303f8

Browse files
committed
use delete confirmation modal
1 parent 62a57b0 commit cc303f8

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

photon-client/src/components/settings/RecordingsCard.vue

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useTheme } from "vuetify";
55
import { axiosPost } from "@/lib/PhotonUtils";
66
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
77
import PvSelect from "@/components/common/pv-select.vue";
8+
import PvDeleteModal from "@/components/common/pv-delete-modal.vue";
89
import { useSettingsStore } from "@/stores/settings/GeneralSettingsStore";
910
1011
const theme = useTheme();
@@ -33,8 +34,6 @@ const deleteRecordings = async (recordingsToDelete: string[], cameraUniqueName:
3334
recordings: recordingsToDelete,
3435
cameraUniqueName: cameraUniqueName
3536
});
36-
37-
confirmDeleteDialog.value.show = false;
3837
};
3938
4039
const exportRecordings = ref();
@@ -245,31 +244,14 @@ const nukeRecordings = () => {
245244
</v-card-text>
246245
</v-card>
247246
</v-dialog>
248-
<v-dialog v-model="confirmDeleteDialog.show" width="600">
249-
<v-card color="surface" dark>
250-
<v-card-title>Delete Recording</v-card-title>
251-
<v-card-text class="pt-0">
252-
Are you sure you want to delete the recording(s) {{ confirmDeleteDialog.recordings.join(", ") }}?
253-
<v-card-actions class="pt-5 pb-0 pr-0" style="justify-content: flex-end">
254-
<v-btn
255-
:variant="theme.global.name.value === 'LightTheme' ? 'elevated' : 'outlined'"
256-
color="buttonPassive"
257-
@click="confirmDeleteDialog.show = false"
258-
>
259-
Cancel
260-
</v-btn>
261-
<v-btn
262-
:variant="theme.global.name.value === 'LightTheme' ? 'elevated' : 'outlined'"
263-
color="error"
264-
@click="deleteRecordings(confirmDeleteDialog.recordings, confirmDeleteDialog.cameraUniqueName)"
265-
>
266-
Delete
267-
</v-btn>
268-
</v-card-actions>
269-
</v-card-text>
270-
</v-card>
271-
</v-dialog>
272247
</v-card>
248+
249+
<pv-delete-modal
250+
v-model="confirmDeleteDialog.show"
251+
title="Confirm Delete Recordings"
252+
:description="'Are you sure you want to delete the recording(s) ' + confirmDeleteDialog.recordings.join(', ') + '?'"
253+
@confirm="() => deleteRecordings(confirmDeleteDialog.recordings, confirmDeleteDialog.cameraUniqueName)"
254+
/>
273255
</template>
274256

275257
<style scoped lang="scss">

0 commit comments

Comments
 (0)