From e559214d67451d1293f73c969460253832793997 Mon Sep 17 00:00:00 2001 From: Rakma Date: Sat, 17 Aug 2024 14:32:12 +0200 Subject: [PATCH] fix: temporary history --- src-frontend/views/DownloadView.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src-frontend/views/DownloadView.vue b/src-frontend/views/DownloadView.vue index f85475d..a75a517 100644 --- a/src-frontend/views/DownloadView.vue +++ b/src-frontend/views/DownloadView.vue @@ -4,6 +4,13 @@ import { useApiStore } from '@/stores/api.ts'; import { useToast } from 'primevue/usetoast'; import IconDownload from '@/components/icons/IconDownload.vue'; +interface DownloadHistoryItem { + url: string; + file: string; + path: string; + timestamp: string; +} + const toast = useToast(); const apiStore = useApiStore(); @@ -12,7 +19,7 @@ const formatType = ref(''); const metaData = ref(true); const saveTo = ref(''); const loading = ref(false); -const downloadHistory = ref<[{}]>([]); +const downloadHistory = ref([]); const getFormattedTimestamp = () => { const date = new Date(); @@ -64,7 +71,7 @@ const download = async (): Promise => { detail: `${response.name} saved to ${response.path}.`, life: 3000 }); - downloadHistory.value.push({ + downloadHistory.value.unshift({ url: videoUrl.value, file: response.name, path: response.path, @@ -76,7 +83,7 @@ const download = async (): Promise => { toast.add({ severity: 'error', summary: 'Error', - detail: err.message, + detail: err, life: 3000 }); }).finally(() => { @@ -120,7 +127,7 @@ const download = async (): Promise => {
- +