Fix reaction limit

This commit is contained in:
Isaac 2024-08-13 07:27:30 +08:00
parent 09da967592
commit babdec7c07
3 changed files with 14 additions and 3 deletions

View File

@ -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)
}

View File

@ -1402,6 +1402,9 @@ public class PeerAllowedReactionsScreen: ViewControllerComponentContainer {
case .empty:
isEnabled = false
}
if let starsAllowed = reactionSettings.starsAllowed, starsAllowed {
isEnabled = true
}
}
var missingReactionFiles: [Int64] = []

View File

@ -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 = ""