Skip to content

Commit

Permalink
Update drive_attach_cubit.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Oct 30, 2024
1 parent c9b1563 commit bbd0609
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/blocs/drive_attach/drive_attach_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,17 @@ class DriveAttachCubit extends Cubit<DriveAttachState> {
profileKey: _profileKey,
);

emit(DriveAttachSuccess());

/// Wait for the sync to finish before syncing the newly attached drive.
await _syncBloc.waitCurrentSync();
_syncBloc.waitCurrentSync().then((value) {
logger.d('after sync drives attach');

/// Then, sync and select the newly attached drive.
unawaited(_syncBloc.startSync());

/// Then, sync and select the newly attached drive.
unawaited(_syncBloc
.startSync()
.then((value) => _drivesBloc.selectDrive(driveId)));
_drivesBloc.selectDrive(driveId);
});

emit(DriveAttachSuccess());

PlausibleEventTracker.trackAttachDrive(
drivePrivacy: drivePrivacy,
Expand Down

0 comments on commit bbd0609

Please sign in to comment.