Fix inline chat list theme update

This commit is contained in:
Ali
2022-11-18 19:35:20 +04:00
parent 7338393c59
commit 8687b65acd
7 changed files with 85 additions and 87 deletions

View File

@@ -694,17 +694,19 @@ public final class ChatTitleView: UIView, NavigationBarTitleView {
}
public func updateThemeAndStrings(theme: PresentationTheme, strings: PresentationStrings, hasEmbeddedTitleContent: Bool) {
self.theme = theme
self.hasEmbeddedTitleContent = hasEmbeddedTitleContent
self.strings = strings
let titleContent = self.titleContent
self.titleCredibilityIcon = .none
self.titleContent = titleContent
let _ = self.updateStatus()
if !self.manualLayout, let (size, clearBounds) = self.validLayout {
self.updateLayout(size: size, clearBounds: clearBounds, transition: .immediate)
if self.theme !== theme || self.strings !== strings || self.hasEmbeddedTitleContent != hasEmbeddedTitleContent {
self.theme = theme
self.hasEmbeddedTitleContent = hasEmbeddedTitleContent
self.strings = strings
let titleContent = self.titleContent
self.titleCredibilityIcon = .none
self.titleContent = titleContent
let _ = self.updateStatus()
if !self.manualLayout, let (size, clearBounds) = self.validLayout {
self.updateLayout(size: size, clearBounds: clearBounds, transition: .immediate)
}
}
}
@@ -1009,6 +1011,7 @@ public final class ChatTitleComponent: Component {
if contentView.titleContent != component.content {
contentView.titleContent = component.content
}
contentView.updateThemeAndStrings(theme: component.theme, strings: component.strings, hasEmbeddedTitleContent: false)
contentView.updateLayout(size: availableSize, clearBounds: CGRect(origin: CGPoint(), size: availableSize), transition: transition.containedViewLayoutTransition)
transition.setFrame(view: contentView, frame: CGRect(origin: CGPoint(), size: availableSize))