Automatically update the backup view when the backup is completed

This commit is contained in:
Dane Everitt
2020-04-06 21:22:57 -07:00
parent b1e7e0b8b0
commit 7f2b477538
3 changed files with 45 additions and 2 deletions

View File

@@ -44,6 +44,9 @@ export default () => {
{backups.map((backup, index) => <BackupRow
key={backup.uuid}
backup={backup}
onBackupUpdated={data => setBackups(
s => ([ ...s.map(b => b.uuid === data.uuid ? data : b) ]),
)}
className={index !== (backups.length - 1) ? 'mb-2' : undefined}
/>)}
</div>
@@ -51,7 +54,7 @@ export default () => {
<Can action={'backup.create'}>
<div className={'mt-6 flex justify-end'}>
<CreateBackupButton
onBackupGenerated={backup => setBackups(s => [...s, backup])}
onBackupGenerated={backup => setBackups(s => [ ...s, backup ])}
/>
</div>
</Can>