Fix backup not resuming after closed and reopen ()

* Fixed app not resuming backup after closing and reopening the app

* Fixed cosmetic effect of backup button doesn't change state right away after pressing start backup

* Fixed grammar

* Fixed deep copy problem that cause incorrect asset count when backing up

* Format code
This commit is contained in:
Alex 2022-06-25 15:12:47 -05:00 committed by GitHub
parent d02b97e1c1
commit 40a8115101
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 677 additions and 300 deletions
mobile/lib/modules/backup/views

View file

@ -26,7 +26,7 @@ class BackupControllerPage extends HookConsumerWidget {
useEffect(() {
if (backupState.backupProgress != BackUpProgressEnum.inProgress) {
ref.read(backupProvider.notifier).getBackupInfo();
ref.watch(backupProvider.notifier).getBackupInfo();
}
ref
@ -112,13 +112,15 @@ class BackupControllerPage extends HookConsumerWidget {
),
),
onPressed: () {
isAutoBackup
? ref
.watch(authenticationProvider.notifier)
.setAutoBackup(false)
: ref
.watch(authenticationProvider.notifier)
.setAutoBackup(true);
if (isAutoBackup) {
ref
.read(authenticationProvider.notifier)
.setAutoBackup(false);
} else {
ref
.read(authenticationProvider.notifier)
.setAutoBackup(true);
}
},
child: Text("Turn $backupBtnText Backup",
style: const TextStyle(fontWeight: FontWeight.bold)),
@ -212,7 +214,7 @@ class BackupControllerPage extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Albums to be backup",
"Albums to be backed up",
style: TextStyle(color: Color(0xFF808080), fontSize: 12),
),
_buildSelectedAlbumName(),
@ -282,14 +284,12 @@ class BackupControllerPage extends HookConsumerWidget {
),
BackupInfoCard(
title: "Backup",
subtitle:
"Photos and videos from selected albums that are backup",
subtitle: "Backed up photos and videos",
info: "${backupState.selectedAlbumsBackupAssetsIds.length}",
),
BackupInfoCard(
title: "Remainder",
subtitle:
"Photos and videos that has not been backing up from selected albums",
subtitle: "Remaining photos and albums to back up from selection",
info:
"${backupState.allUniqueAssets.length - backupState.selectedAlbumsBackupAssetsIds.length}",
),