Various fixes

This commit is contained in:
Ilya Laktyushin
2024-08-07 14:58:25 +02:00
parent c504c1d70e
commit c400ccda24
8 changed files with 128 additions and 21 deletions

View File

@@ -911,6 +911,7 @@ private final class StarsSubscriptionsContextImpl {
private let disposable = MetaDisposable()
private var stateDisposable: Disposable?
private let updateDisposable = MetaDisposable()
init(account: Account, starsContext: StarsContext) {
assert(Queue.mainQueue().isCurrent())
@@ -931,6 +932,7 @@ private final class StarsSubscriptionsContextImpl {
assert(Queue.mainQueue().isCurrent())
self.disposable.dispose()
self.stateDisposable?.dispose()
self.updateDisposable.dispose()
}
func loadMore() {
@@ -978,6 +980,7 @@ private final class StarsSubscriptionsContextImpl {
updatedState.subscriptions[index] = updatedSubscription
}
self.updateState(updatedState)
self.updateDisposable.set(_internal_updateStarsSubscription(account: self.account, peerId: self.account.peerId, subscriptionId: id, cancel: cancel).startStrict())
}
}

View File

@@ -93,9 +93,5 @@ public extension TelegramEngine {
public func sendStarsPaymentForm(formId: Int64, source: BotPaymentInvoiceSource) -> Signal<SendBotPaymentResult, SendBotPaymentFormError> {
return _internal_sendStarsPaymentForm(account: self.account, formId: formId, source: source)
}
public func updateStarsSubscription(peerId: EnginePeer.Id, subscriptionId: String, cancel: Bool) -> Signal<Never, UpdateStarsSubsciptionError> {
return _internal_updateStarsSubscription(account: self.account, peerId: peerId, subscriptionId: subscriptionId, cancel: cancel)
}
}
}