diff --git a/lib/blocs/drive_detail/drive_detail_cubit.dart b/lib/blocs/drive_detail/drive_detail_cubit.dart index 46b7948e0..eeea5c7c0 100644 --- a/lib/blocs/drive_detail/drive_detail_cubit.dart +++ b/lib/blocs/drive_detail/drive_detail_cubit.dart @@ -138,12 +138,21 @@ class DriveDetailCubit extends Cubit { _folderSubscription = Rx.combineLatest3( _driveRepository.watchDrive(driveId: driveId), - _driveDao.watchFolderContents( + _driveDao + .watchFolderContents( driveId, orderBy: contentOrderBy, orderingMode: contentOrderingMode, folderId: folderId, - ), + ) + .handleError((error, stack) { + logger.e('Error watching folder contents', error, stack); + if (error is DriveNotFoundException) { + emit(DriveDetailLoadNotFound()); + } + + return null; + }), _profileCubit.stream.startWith(ProfileCheckingAvailability()), (drive, folderContents, _) async { if (isClosed) { diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index fdb05db35..6a67e56d7 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -132,7 +132,8 @@ class _DriveDetailPageState extends State { child: BlocListener( listener: (context, state) { if (state is DrivesLoadSuccess) { - if (state.userDrives.isNotEmpty) { + if (state.userDrives.isNotEmpty || + state.sharedDrives.isNotEmpty) { final driveDetailState = context.read().state; if (driveDetailState is DriveDetailLoadSuccess &&