Skip to content

Commit 7eed291

Browse files
author
Isaac
committed
Update sort order
1 parent 87ba2ef commit 7eed291

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

submodules/TelegramUI/Components/PeerInfo/AffiliateProgramSetupScreen/Sources/AffiliateProgramSetupScreen.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ final class AffiliateProgramSetupScreenComponent: Component {
121121

122122
private var suggestedStarBotList: TelegramSuggestedStarRefBotList?
123123
private var suggestedStarBotListDisposable: Disposable?
124-
private var suggestedSortMode: TelegramSuggestedStarRefBotList.SortMode = .date
124+
private var suggestedSortMode: TelegramSuggestedStarRefBotList.SortMode = .profitability
125125
private var isSuggestedSortModeUpdating: Bool = false
126126

127127
override init(frame: CGRect) {
@@ -417,9 +417,9 @@ If you end your affiliate program:
417417
var items: [ContextMenuItem] = []
418418

419419
let availableModes: [(TelegramSuggestedStarRefBotList.SortMode, String)] = [
420-
(.date, "Date"),
420+
(.profitability, "Profitability"),
421421
(.revenue, "Revenue"),
422-
(.profitability, "Profitability")
422+
(.date, "Date")
423423
]
424424
for (mode, title) in availableModes {
425425
let isSelected = mode == self.suggestedSortMode
@@ -1363,6 +1363,13 @@ If you end your affiliate program:
13631363
}
13641364
do {
13651365
var suggestedSectionItems: [AnyComponentWithIdentity<Empty>] = []
1366+
if suggestedStarBotListItems.isEmpty {
1367+
suggestedSectionItems.append(AnyComponentWithIdentity(id: "empty", component: AnyComponent(TransformContents(
1368+
content: AnyComponent(),
1369+
fixedSize: CGSize(width: 1.0, height: 100.0),
1370+
translation: CGPoint()
1371+
))))
1372+
}
13661373
for item in suggestedStarBotListItems {
13671374
let commissionTitle = "\(item.program.commissionPermille / 10)%"
13681375
let durationTitle: String

0 commit comments

Comments
 (0)