From ac2b7acef9c4390a61a30884a05589723f572403 Mon Sep 17 00:00:00 2001
From: Mitaly <shubhamsapra@hotmail.com>
Date: Thu, 19 Sep 2024 12:44:19 +0530
Subject: [PATCH] Update backup.provider.dart

---
 mobile/lib/providers/backup/backup.provider.dart | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mobile/lib/providers/backup/backup.provider.dart b/mobile/lib/providers/backup/backup.provider.dart
index 9329f9b1f7..14359e3afc 100644
--- a/mobile/lib/providers/backup/backup.provider.dart
+++ b/mobile/lib/providers/backup/backup.provider.dart
@@ -313,6 +313,9 @@ class BackupNotifier extends StateNotifier<BackUpState> {
   /// Those assets are unique and are used as the total assets
   ///
   Future<void> _updateBackupAssetCount() async {
+    // Save to persistent storage
+    await _updatePersistentAlbumsSelection();
+
     final duplicatedAssetIds = await _backupService.getDuplicatedAssetIds();
     final Set<BackupCandidate> assetsFromSelectedAlbums = {};
     final Set<BackupCandidate> assetsFromExcludedAlbums = {};
@@ -409,8 +412,6 @@ class BackupNotifier extends StateNotifier<BackUpState> {
       );
     }
 
-    // Save to persistent storage
-    await _updatePersistentAlbumsSelection();
   }
 
   /// Get all necessary information for calculating the available albums,