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) #1917

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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) {
Comment on lines +135 to +136
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were showing the empty state when we only have shared drives

final driveDetailState = context.read<DriveDetailCubit>().state;

if (driveDetailState is DriveDetailLoadSuccess &&
Expand Down
Loading