chore: refresh backup stats when entering backup page (#21977)

* chore: refresh backup stats when entering backup page

* check for success status

* remove logs

* remove sync remote when toggle the button

* show status immediately after navigating to screen

* pr feedback
This commit is contained in:
Alex 2025-09-18 15:36:43 -05:00 committed by GitHub
parent dcbc266b83
commit d36c26bf97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 57 additions and 7 deletions

View file

@ -235,7 +235,9 @@ class DriftBackupNotifier extends StateNotifier<DriftBackupState> {
switch (update.status) {
case TaskStatus.complete:
if (update.task.group == kBackupGroup) {
state = state.copyWith(backupCount: state.backupCount + 1, remainderCount: state.remainderCount - 1);
if (update.responseStatusCode == 201) {
state = state.copyWith(backupCount: state.backupCount + 1, remainderCount: state.remainderCount - 1);
}
}
// Remove the completed task from the upload items