Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix attach drives #1910

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/en-US/changelogs/160.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixes an issue attaching drives
19 changes: 14 additions & 5 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
}

Future<void> changeDrive(String driveId) async {
logger.d('changeDrive on cubit: $driveId');

final drive = await _driveDao.driveById(driveId: driveId).getSingleOrNull();

if (drive == null) {
Expand Down Expand Up @@ -138,15 +140,22 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
_folderSubscription =
Rx.combineLatest3<Drive?, FolderWithContents, ProfileState, void>(
_driveRepository.watchDrive(driveId: driveId),
_driveDao.watchFolderContents(
_driveDao
.watchFolderContents(
driveId,
orderBy: contentOrderBy,
orderingMode: contentOrderingMode,
folderId: folderId,
),
)
.handleError((e) {
if (e is DriveNotFoundException) {
emit(DriveDetailLoadNotFound());
}
}),
_profileCubit.stream.startWith(ProfileCheckingAvailability()),
(drive, folderContents, _) async {
if (isClosed) {
logger.d('drive detail cubit is closed');
return;
}

Expand Down Expand Up @@ -290,11 +299,11 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
emit(DriveDetailLoadNotFound());
return;
}

logger.e('An error occured mouting the drive explorer', e);
});

await _folderSubscription?.asFuture();
await _folderSubscription?.asFuture().catchError((e, stacktrace) {
emit(DriveDetailLoadNotFound());
});
}

List<ArDriveDataTableItem> parseEntitiesToDatatableItem({
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Secure, permanent storage

publish_to: 'none'

version: 2.57.0
version: 2.57.1

environment:
sdk: '>=3.2.0 <4.0.0'
Expand Down
Loading