mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Merge branch 'beta' into formatted-date-api
This commit is contained in:
commit
c9ea813970
1 changed files with 1 additions and 22 deletions
|
|
@ -479,28 +479,7 @@ public enum StarGift: Equatable, Codable, PostboxCoding {
|
|||
return false
|
||||
}
|
||||
|
||||
public var badgeText: String {
|
||||
switch self {
|
||||
case let .permille(value):
|
||||
if value == 0 {
|
||||
return "<0.1%"
|
||||
}
|
||||
let percent = Double(value) / 10.0
|
||||
if percent.truncatingRemainder(dividingBy: 1) == 0 {
|
||||
return "\(Int(percent))%"
|
||||
} else {
|
||||
return String(format: "%.1f%%", percent)
|
||||
}
|
||||
case .rare:
|
||||
return "rare"
|
||||
case .epic:
|
||||
return "epic"
|
||||
case .legendary:
|
||||
return "legendary"
|
||||
case .uncommon:
|
||||
return "uncommon"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case model(name: String, file: TelegramMediaFile, rarity: Rarity, crafted: Bool)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue