This commit is contained in:
Mikhail Filimonov 2026-02-06 14:38:53 +04:00
parent 63a37c5bec
commit d4a3523fb1

View file

@ -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)