From babdec7c07cd203de5e2d6c56a7b3ec1fd25ef8d Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Tue, 13 Aug 2024 07:27:30 +0800 Subject: [PATCH] Fix reaction limit --- .../BrowserUI/Sources/BrowserDocumentContent.swift | 2 +- .../Sources/PeerAllowedReactionsScreen.swift | 3 +++ .../PeerInfoScreen/Sources/PeerInfoScreen.swift | 12 ++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/submodules/BrowserUI/Sources/BrowserDocumentContent.swift b/submodules/BrowserUI/Sources/BrowserDocumentContent.swift index bb3774ba879..44597c4fbdf 100644 --- a/submodules/BrowserUI/Sources/BrowserDocumentContent.swift +++ b/submodules/BrowserUI/Sources/BrowserDocumentContent.swift @@ -346,7 +346,7 @@ final class BrowserDocumentContent: UIView, BrowserContent, WKNavigationDelegate self.updateScrollingOffset(isReset: true, transition: .spring(duration: 0.4)) } - func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) + func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { self.updateFontState(self.currentFontState, force: true) } diff --git a/submodules/TelegramUI/Components/PeerAllowedReactionsScreen/Sources/PeerAllowedReactionsScreen.swift b/submodules/TelegramUI/Components/PeerAllowedReactionsScreen/Sources/PeerAllowedReactionsScreen.swift index a8bbe1b0166..b347a46bfda 100644 --- a/submodules/TelegramUI/Components/PeerAllowedReactionsScreen/Sources/PeerAllowedReactionsScreen.swift +++ b/submodules/TelegramUI/Components/PeerAllowedReactionsScreen/Sources/PeerAllowedReactionsScreen.swift @@ -1402,6 +1402,9 @@ public class PeerAllowedReactionsScreen: ViewControllerComponentContainer { case .empty: isEnabled = false } + if let starsAllowed = reactionSettings.starsAllowed, starsAllowed { + isEnabled = true + } } var missingReactionFiles: [Int64] = [] diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 246826732e0..41a613f8f56 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -1993,9 +1993,17 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL case .all: label = presentationData.strings.PeerInfo_LabelAllReactions case .empty: - label = presentationData.strings.PeerInfo_ReactionsDisabled + if let starsAllowed = reactionSettings.starsAllowed, starsAllowed { + label = "1" + } else { + label = presentationData.strings.PeerInfo_ReactionsDisabled + } case let .limited(reactions): - label = "\(reactions.count)" + var countValue = reactions.count + if let starsAllowed = reactionSettings.starsAllowed, starsAllowed { + countValue += 1 + } + label = "\(countValue)" } } else { label = ""