Skip to content

Commit

Permalink
get rid of legacy backup
Browse files Browse the repository at this point in the history
  • Loading branch information
AriaMoradi committed Aug 21, 2021
1 parent 058d4cd commit 9f6a76c
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions src/screens/settings/Backup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -83,18 +80,6 @@ export default function Backup() {
secondary="You can also drag and drop the backup file here to restore"
/>
</ListItem>
<ListItemLink href={`${baseURL}/api/v1/backup/legacy/export/file`}>
<ListItemText
primary="Create Legacy Backup"
secondary="Backup library as a Tachiyomi legacy backup"
/>
</ListItemLink>
<ListItem button onClick={() => document.getElementById('backup-file')?.click()}>
<ListItemText
primary="Restore Legacy Backup"
secondary="You can also drag and drop the backup file here to restore"
/>
</ListItem>
</List>
<input
type="file"
Expand Down

0 comments on commit 9f6a76c

Please sign in to comment.