Skip to content

Commit

Permalink
Merge pull request #605 from ardriveapp/PE-1935-drive-state-is-not-lo…
Browse files Browse the repository at this point in the history
…cally-cached

fix: save drive state locally
  • Loading branch information
thiagocarvalhodev authored Aug 8, 2022
2 parents 5137a59 + 42ef7cb commit ffc6334
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions lib/blocs/sync/sync_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ class SyncCubit extends Cubit<SyncState> {

_syncProgress = _syncProgress.copyWith(drivesCount: drives.length);

syncFormatedPrint('Current block height number $currentBlockHeight');

final driveSyncProcesses = drives.map((drive) => _syncDrive(
drive.id,
lastBlockHeight: calculateSyncLastBlockHeight(
Expand Down Expand Up @@ -582,7 +580,6 @@ class SyncCubit extends Cubit<SyncState> {
200 ~/ (_syncProgress.drivesCount - _syncProgress.drivesSynced);
var currentDriveEntitiesSynced = 0;
var driveSyncProgress = 0.0;

syncFormatedPrint(
'number of drives at get metadata phase : ${_syncProgress.numberOfDrivesAtGetMetadataPhase}');

Expand Down
6 changes: 5 additions & 1 deletion lib/pages/app_router_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ class AppRouterDelegate extends RouterDelegate<AppRoutePath>
// TODO: Find a better place to do this
final lastLoggedInUser =
state is ProfileLoggedIn ? state.walletAddress : null;
context.read<DriveDao>().deleteSharedPrivateDrives(lastLoggedInUser);
if (lastLoggedInUser != null) {
context
.read<DriveDao>()
.deleteSharedPrivateDrives(lastLoggedInUser);
}
},
builder: (context, state) {
Widget? shell;
Expand Down

0 comments on commit ffc6334

Please sign in to comment.