Skip to content

Commit

Permalink
video: Disable download and delete buttons while download is being pr…
Browse files Browse the repository at this point in the history
…epared
  • Loading branch information
rafaellehmkuhl authored and ArturoManzoli committed Jun 20, 2024
1 parent 387b5ca commit c338b12
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/VideoLibraryModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
v-for="button in fileActionButtons"
:key="button.name"
class="flex flex-col justify-center ml-6 align-center"
:disabled="button.disabled || false"
:disabled="button.disabled"
@click="!button.confirmAction && button.action()"
>
<div
Expand All @@ -323,6 +323,7 @@
location="left center"
opacity="0"
transition="slide-x-reverse-transition"
:disabled="button.disabled"
>
<template #activator="{ props: buttonProps, isActive }">
<div class="flex items-center justify-center w-full h-full" v-bind="buttonProps">
Expand Down Expand Up @@ -523,6 +524,7 @@ const showProgressInteractionDialog = ref(false)
const progressInteractionDialogTitle = ref('')
const progressInteractionDialogActions = ref<DialogActions[]>([])
const isProcessingVideos = ref(false)
const isPreparingDownload = ref(false)
const overallProcessingProgress = ref(0)
const currentVideoProcessingProgress = ref([{ fileName: '', progress: 0, message: '' }])
const numberOfFilesToProcess = ref(0)
Expand All @@ -544,7 +546,7 @@ const fileActionButtons = computed(() => [
tooltip: '',
confirmAction: true,
show: true,
disabled: showOnScreenProgress.value === true,
disabled: showOnScreenProgress.value === true || isPreparingDownload.value === true,
action: () => discardVideosAndUpdateDB(),
},
{
Expand All @@ -554,7 +556,7 @@ const fileActionButtons = computed(() => [
tooltip: 'Download selected videos with logs',
confirmAction: false,
show: true,
disabled: showOnScreenProgress.value === true,
disabled: showOnScreenProgress.value === true || isPreparingDownload.value === true,
action: () => downloadVideoAndTelemetryFiles(),
},
])
Expand Down Expand Up @@ -763,6 +765,7 @@ const downloadVideoAndTelemetryFiles = async (): Promise<void> => {
if (!confirm) return
}
isPreparingDownload.value = true
if (tempProcessedVideos.length > 0) {
const dataLogFilesAdded = addLogDataToFileList(tempProcessedVideos)
Expand All @@ -771,6 +774,7 @@ const downloadVideoAndTelemetryFiles = async (): Promise<void> => {
if (tempUnprocessedVideos.length > 0) {
await videoStore.downloadTempVideo(tempUnprocessedVideos, fillProgressData)
}
isPreparingDownload.value = false
}
const confirmDownloadOfUnprocessedVideos = async (): Promise<boolean> => {
Expand Down

0 comments on commit c338b12

Please sign in to comment.