Skip to content

Commit

Permalink
fix: refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangbtmrk committed May 6, 2024
1 parent 89fbda9 commit 6c65096
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/util/asset_token_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ extension AssetTokenExtension on AssetToken {
if (title == null) {
return null;
}
final displayTitle = title ?? '';
if (mintedAt != null) {
return '$displayTitle (${mintedAt!.year})';
}

return displayTitle;
return mintedAt != null ? '$title (${mintedAt!.year})' : title;
}

bool get hasMetadata => galleryThumbnailURL != null;
Expand Down Expand Up @@ -473,12 +469,8 @@ extension CompactedAssetTokenExtension on CompactedAssetToken {
if (title == null) {
return null;
}
final displayTitle = title ?? '';
if (mintedAt != null) {
return '$displayTitle (${mintedAt!.year})';
}

return displayTitle;
return mintedAt != null ? '$title (${mintedAt!.year})' : title;
}

bool get isPostcard {
Expand Down

0 comments on commit 6c65096

Please sign in to comment.