chore: do not remote sync twice in backup page (#22484)

do not remote sync twice in backup page

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-09-29 23:44:01 +05:30 committed by GitHub
parent 75b9bd163e
commit 44284b4351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 10 deletions

View file

@ -65,7 +65,9 @@ class BackupToggleButtonState extends ConsumerState<BackupToggleButton> with Sin
final uploadTasks = ref.watch(driftBackupProvider.select((state) => state.uploadItems));
final isUploading = uploadTasks.isNotEmpty;
final isSyncing = ref.watch(driftBackupProvider.select((state) => state.isSyncing));
final isProcessing = uploadTasks.isNotEmpty || isSyncing;
return AnimatedBuilder(
animation: _animationController,
@ -129,7 +131,7 @@ class BackupToggleButtonState extends ConsumerState<BackupToggleButton> with Sin
],
),
),
child: isUploading
child: isProcessing
? const SizedBox(width: 24, height: 24, child: CircularProgressIndicator(strokeWidth: 2))
: Icon(Icons.cloud_upload_outlined, color: context.primaryColor, size: 24),
),