mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-26 00:14:57 +00:00
core, ui: make badge expiration non-optional (#7445)
* core, ui: make badge expiration non-optional * update * update bot types * fix to use non-optional badge expiry --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgeny @ SimpleX Chat
parent
f99c474ca6
commit
735662902f
+1
-1
@@ -2182,7 +2182,7 @@ enum class BadgeStatus {
|
||||
@Serializable
|
||||
data class BadgeInfo(
|
||||
val badgeType: BadgeType,
|
||||
val badgeExpiry: Instant? = null,
|
||||
val badgeExpiry: Instant,
|
||||
val badgeExtra: String = ""
|
||||
)
|
||||
|
||||
|
||||
+2
-3
@@ -231,10 +231,9 @@ fun showBadgeInfoAlert(name: String, badge: LocalBadge, uriHandler: UriHandler)
|
||||
)
|
||||
else -> {
|
||||
// Supporter, Legend and unknown types use the supporter wording
|
||||
val expiry = badge.badge.badgeExpiry
|
||||
val supports =
|
||||
if (badge.status == BadgeStatus.Expired && expiry != null)
|
||||
String.format(generalGetString(MR.strings.badge_supported_simplex), name, localDate(expiry))
|
||||
if (badge.status == BadgeStatus.Expired)
|
||||
String.format(generalGetString(MR.strings.badge_supported_simplex), name, localDate(badge.badge.badgeExpiry))
|
||||
else
|
||||
String.format(generalGetString(MR.strings.badge_supports_simplex), name)
|
||||
AlertManager.shared.showAlertMsg(
|
||||
|
||||
Reference in New Issue
Block a user