mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various improvements
This commit is contained in:
@@ -375,7 +375,9 @@ extension ChatControllerImpl {
|
||||
}
|
||||
if let itemNode = itemNode, let targetView = itemNode.targetReactionView(value: chosenReaction) {
|
||||
if !"".isEmpty {
|
||||
self.chatDisplayNode.wrappingNode.triggerRipple(at: targetView.convert(targetView.bounds.center, to: self.chatDisplayNode.view))
|
||||
if self.context.sharedContext.energyUsageSettings.fullTranslucency {
|
||||
self.chatDisplayNode.wrappingNode.triggerRipple(at: targetView.convert(targetView.bounds.center, to: self.chatDisplayNode.view))
|
||||
}
|
||||
}
|
||||
}
|
||||
}, completion: {})
|
||||
@@ -390,13 +392,29 @@ extension ChatControllerImpl {
|
||||
guard let starsContext = self.context.starsContext else {
|
||||
return
|
||||
}
|
||||
let _ = (starsContext.state
|
||||
guard let peerId = self.chatLocation.peerId else {
|
||||
return
|
||||
}
|
||||
let _ = (combineLatest(
|
||||
starsContext.state,
|
||||
self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.ReactionSettings(id: peerId))
|
||||
)
|
||||
|> take(1)
|
||||
|> deliverOnMainQueue).start(next: { [weak self] state in
|
||||
|> deliverOnMainQueue).start(next: { [weak self] state, reactionSettings in
|
||||
guard let strongSelf = self, let balance = state?.balance else {
|
||||
return
|
||||
}
|
||||
|
||||
if case let .known(reactionSettings) = reactionSettings, let starsAllowed = reactionSettings.starsAllowed, !starsAllowed {
|
||||
if let peer = strongSelf.presentationInterfaceState.renderedPeer?.chatMainPeer {
|
||||
//TODO:localize
|
||||
strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: "Star Reactions were disabled in \(peer.debugDisplayTitle).", actions: [
|
||||
TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_OK, action: {})
|
||||
]), in: .window(.root))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if balance < 1 {
|
||||
controller?.dismiss(completion: {
|
||||
guard let strongSelf = self else {
|
||||
@@ -406,7 +424,7 @@ extension ChatControllerImpl {
|
||||
let _ = (strongSelf.context.engine.payments.starsTopUpOptions()
|
||||
|> take(1)
|
||||
|> deliverOnMainQueue).startStandalone(next: { [weak strongSelf] options in
|
||||
guard let strongSelf, let peerId = strongSelf.chatLocation.peerId else {
|
||||
guard let strongSelf else {
|
||||
return
|
||||
}
|
||||
guard let starsContext = strongSelf.context.starsContext else {
|
||||
|
||||
Reference in New Issue
Block a user