Skip to content

Commit

Permalink
feat(image preview): navigate only through visible images PE-5345
Browse files Browse the repository at this point in the history
  • Loading branch information
matibat committed Jan 6, 2024
1 parent 6873b92 commit 009aa85
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,30 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
}

final state = this.state as DriveDetailLoadSuccess;
final allImagesForFolder = state.currentFolderContents
.whereType<FileDataTableItem>()
.where(
(element) => supportedImageTypesInFilePreview.contains(
element.contentType,
),
)
.toList();

final isShowingHiddenFiles = state.isShowingHiddenFiles;

final List<FileDataTableItem> allImagesForFolder;
if (isShowingHiddenFiles) {
allImagesForFolder = state.currentFolderContents
.whereType<FileDataTableItem>()
.where(
(element) => supportedImageTypesInFilePreview.contains(
element.contentType,
),
)
.toList();
} else {
allImagesForFolder = state.currentFolderContents
.whereType<FileDataTableItem>()
.where(
(element) => supportedImageTypesInFilePreview.contains(
element.contentType,
),
)
.where((e) => !e.isHidden)
.toList();
}

_allImagesOfCurrentFolder = allImagesForFolder;

Expand Down

0 comments on commit 009aa85

Please sign in to comment.