chore(mobile): clear the backup detail view when no backup is in progress (#17619)

Clear the backup detail view when no backup is in progress

* When no backup is in progress, display a simple "-" for the details in the upload file info, instead of the data of the last uploaded asset.
* This prevents confusion if a upload job is stuck or just finished.
This commit is contained in:
Toni 2025-04-15 18:30:24 +02:00 committed by GitHub
parent 3eb316abea
commit 7c422363fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,15 @@ class BackupAssetInfoTable extends ConsumerWidget {
), ),
); );
final isUploadInProgress = ref.watch(
backupProvider.select(
(value) =>
value.backupProgress == BackUpProgressEnum.inProgress ||
value.backupProgress == BackUpProgressEnum.inBackground ||
value.backupProgress == BackUpProgressEnum.manualInProgress,
),
);
final asset = isManualUpload final asset = isManualUpload
? ref.watch( ? ref.watch(
manualUploadProvider.select((value) => value.currentUploadAsset), manualUploadProvider.select((value) => value.currentUploadAsset),
@ -47,7 +56,9 @@ class BackupAssetInfoTable extends ConsumerWidget {
fontSize: 10.0, fontSize: 10.0,
), ),
).tr( ).tr(
args: [asset.fileName, asset.fileType.toLowerCase()], args: isUploadInProgress
? [asset.fileName, asset.fileType.toLowerCase()]
: ["-", "-"],
), ),
), ),
), ),
@ -67,7 +78,9 @@ class BackupAssetInfoTable extends ConsumerWidget {
fontSize: 10.0, fontSize: 10.0,
), ),
).tr( ).tr(
args: [_getAssetCreationDate(asset)], args: [
isUploadInProgress ? _getAssetCreationDate(asset) : "-",
],
), ),
), ),
), ),
@ -85,7 +98,11 @@ class BackupAssetInfoTable extends ConsumerWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10.0, fontSize: 10.0,
), ),
).tr(args: [asset.id]), ).tr(
args: [
isUploadInProgress ? asset.id : "-",
],
),
), ),
), ),
], ],