Skip to content

Commit

Permalink
Merge pull request #1917 from ardriveapp/fix-attach-drives
Browse files Browse the repository at this point in the history
fix(attach drives)
  • Loading branch information
thiagocarvalhodev authored Nov 18, 2024
2 parents 656eb02 + 4681e2d commit d2f596a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 11 additions & 2 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,21 @@ 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((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) {
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/drive_detail/drive_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class _DriveDetailPageState extends State<DriveDetailPage> {
child: BlocListener<DrivesCubit, DrivesState>(
listener: (context, state) {
if (state is DrivesLoadSuccess) {
if (state.userDrives.isNotEmpty) {
if (state.userDrives.isNotEmpty ||
state.sharedDrives.isNotEmpty) {
final driveDetailState = context.read<DriveDetailCubit>().state;

if (driveDetailState is DriveDetailLoadSuccess &&
Expand Down

0 comments on commit d2f596a

Please sign in to comment.