Skip to content

Commit

Permalink
Merge pull request #1472 from bitmark-inc/sort_artwork
Browse files Browse the repository at this point in the history
Sort artwork
  • Loading branch information
phuocbitmark authored Jan 11, 2024
2 parents bf2e711 + 57d6333 commit 2203fd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions lib/screen/exhibition_details/exhibition_detail_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class ExhibitionDetailBloc
final exhibitionDetail = ExhibitionDetail(
exhibition: result[0] as Exhibition,
artworks: result[1] as List<Artwork>);
exhibitionDetail.artworks!.sort((a, b) {
if (a.index != b.index) {
return a.index.compareTo(b.index);
}
return a.seriesID.compareTo(b.seriesID);
});
exhibitionDetail.artworks!.removeWhere(
(element) => exhibitionDetail.getArtworkTokenId(element) == null);
emit(state.copyWith(exhibitionDetail: exhibitionDetail));
Expand Down
6 changes: 0 additions & 6 deletions lib/screen/exhibition_details/exhibition_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ class _ExhibitionDetailPageState extends State<ExhibitionDetailPage> {
exhibitionDetail.artworks!.isEmpty) {
return;
}
exhibitionDetail.artworks!.sort((a, b) {
if (a.index != b.index) {
a.index.compareTo(b.index);
}
return a.seriesID.compareTo(b.seriesID);
});
final tokenIds = exhibitionDetail.artworks
?.map((e) => exhibitionDetail.getArtworkTokenId(e)!)
.toList();
Expand Down

0 comments on commit 2203fd4

Please sign in to comment.