mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various fixes
This commit is contained in:
@@ -79,6 +79,7 @@ final class GiftOptionsScreenComponent: Component {
|
||||
public enum StarsFilter: Equatable {
|
||||
case all
|
||||
case limited
|
||||
case inStock
|
||||
case stars(Int64)
|
||||
|
||||
init(rawValue: Int64) {
|
||||
@@ -87,6 +88,8 @@ final class GiftOptionsScreenComponent: Component {
|
||||
self = .all
|
||||
case -1:
|
||||
self = .limited
|
||||
case -2:
|
||||
self = .inStock
|
||||
default:
|
||||
self = .stars(rawValue)
|
||||
}
|
||||
@@ -98,6 +101,8 @@ final class GiftOptionsScreenComponent: Component {
|
||||
return 0
|
||||
case .limited:
|
||||
return -1
|
||||
case .inStock:
|
||||
return -2
|
||||
case let .stars(stars):
|
||||
return stars
|
||||
}
|
||||
@@ -159,6 +164,10 @@ final class GiftOptionsScreenComponent: Component {
|
||||
if $0.availability != nil {
|
||||
return true
|
||||
}
|
||||
case .inStock:
|
||||
if $0.availability == nil || $0.availability!.remains > 0 {
|
||||
return true
|
||||
}
|
||||
case let .stars(stars):
|
||||
if $0.price == stars {
|
||||
return true
|
||||
@@ -901,6 +910,11 @@ final class GiftOptionsScreenComponent: Component {
|
||||
title: strings.Gift_Options_Gift_Filter_Limited
|
||||
))
|
||||
}
|
||||
|
||||
tabSelectorItems.append(TabSelectorComponent.Item(
|
||||
id: AnyHashable(StarsFilter.inStock.rawValue),
|
||||
title: strings.Gift_Options_Gift_Filter_InStock
|
||||
))
|
||||
|
||||
let starsAmounts = Array(starsAmountsSet).sorted()
|
||||
for amount in starsAmounts {
|
||||
|
||||
Reference in New Issue
Block a user