diff --git a/src/screens/settings/Backup.tsx b/src/screens/settings/Backup.tsx
index c8313357..d38bb540 100644
--- a/src/screens/settings/Backup.tsx
+++ b/src/screens/settings/Backup.tsx
@@ -26,16 +26,13 @@ export default function Backup() {
const formData = new FormData();
formData.append('backup.proto.gz', file);
+ makeToast('Restoring bacukp....', 'info');
client.post('/api/v1/backup/import/file',
- formData, { headers: { 'Content-Type': 'multipart/form-data' } });
+ formData, { headers: { 'Content-Type': 'multipart/form-data' } })
+ .then(() => makeToast('Backup restore finished!', 'success'))
+ .catch(() => makeToast('Backup restore failed!', 'error'));
} else if (file.name.toLowerCase().endsWith('json')) {
- file.text()
- .then(
- (fileContent: string) => {
- client.post('/api/v1/backup/legacy/import',
- fileContent, { headers: { 'Content-Type': 'application/json' } });
- },
- );
+ makeToast('legacy backups are not supported!', 'error');
} else {
makeToast('invalid file type!', 'error');
}
@@ -83,18 +80,6 @@ export default function Backup() {
secondary="You can also drag and drop the backup file here to restore"
/>
-
-
-
- document.getElementById('backup-file')?.click()}>
-
-