Displaying error when re-download of Archive request fails.

This commit is contained in:
Roland 2024-04-14 14:02:02 -06:00
parent 1795fae1b0
commit 5be4726493
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -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 = <APIButton