From 5be4726493865eed6bc81f121fa320cdca0e6a24 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 14 Apr 2024 14:02:02 -0600 Subject: [PATCH] Displaying error when re-download of Archive request fails. --- app/src/components/Archive.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/components/Archive.js b/app/src/components/Archive.js index 327457d2..1d5bdc56 100644 --- a/app/src/components/Archive.js +++ b/app/src/components/Archive.js @@ -105,13 +105,23 @@ function ArchivePage() { navigate(-1); } const localUpdateArchive = async () => { - await postDownload([data.url], 'archive'); - toast({ - type: 'success', - title: 'Archive Downloading', - description: 'Archive update has been scheduled.', - time: 2000, - }) + const response = await postDownload([archiveFile.url], 'archive'); + if (response.ok) { + toast({ + type: 'success', + title: 'Archive Downloading', + description: 'Archive update has been scheduled.', + time: 2000, + }); + } else { + toast({ + type: 'error', + title: 'Archive Downloading', + description: 'Archive update failed.', + time: 2000, + }); + } + } const updateButton =