Skip to content

Commit

Permalink
Merge pull request #1999 from bitmark-inc/hotfix/exhibition-posts
Browse files Browse the repository at this point in the history
fix: display post even it hasn't thumbnail
  • Loading branch information
hoangbtmrk authored Sep 6, 2024
2 parents 644a80b + c745dde commit 0698060
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 4 additions & 6 deletions lib/screen/exhibition_details/exhibition_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,10 @@ class _ExhibitionDetailPageState extends State<ExhibitionDetailPage>
));
}
if (resource is Post) {
if (resource.coverURI != null) {
resources.add(ExhibitionPostView(
post: resource,
exhibitionID: exhibition.id,
));
}
resources.add(ExhibitionPostView(
post: resource,
exhibitionID: exhibition.id,
));
}
}
return resources;
Expand Down
8 changes: 5 additions & 3 deletions lib/view/post_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class _ExhibitionPostViewState extends State<ExhibitionPostView> {

@override
void initState() {
thumbnailUrl = widget.post.thumbnailUrls[0];
thumbnailUrl = widget.post.thumbnailUrls.firstOrNull;
loadThumbnailFailedCount = 0;
super.initState();
}
Expand Down Expand Up @@ -58,8 +58,10 @@ class _ExhibitionPostViewState extends State<ExhibitionPostView> {
style: theme.textTheme.ppMori400White12,
),
const SizedBox(height: 30),
_buildThumbnailWidget(),
const SizedBox(height: 20),
if (thumbnailUrl != null) ...[
_buildThumbnailWidget(),
const SizedBox(height: 20),
],
Text(
widget.post.title,
style: theme.textTheme.ppMori700White14,
Expand Down

0 comments on commit 0698060

Please sign in to comment.