Message preview and effect improvements

This commit is contained in:
Isaac
2024-05-21 00:02:55 +04:00
parent b420532822
commit fe788ed9ea
26 changed files with 568 additions and 276 deletions

View File

@@ -1384,6 +1384,7 @@ public final class EmojiPagerContentComponent: Component {
private var component: EmojiPagerContentComponent?
private weak var state: EmptyComponentState?
private var isUpdating: Bool = false
private var pagerEnvironment: PagerComponentChildEnvironment?
private var keyboardChildEnvironment: EntityKeyboardChildEnvironment?
private var activeItemUpdated: ActionSlot<(AnyHashable, AnyHashable?, Transition)>?
@@ -4055,6 +4056,11 @@ public final class EmojiPagerContentComponent: Component {
}
func update(component: EmojiPagerContentComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<EnvironmentType>, transition: Transition) -> CGSize {
self.isUpdating = true
defer {
self.isUpdating = false
}
let previousComponent = self.component
self.component = component
@@ -4581,6 +4587,10 @@ public final class EmojiPagerContentComponent: Component {
Transition(animation: .curve(duration: 0.4, curve: .spring)))
}
}
if !strongSelf.isUpdating {
strongSelf.state?.updated(transition: Transition(animation: .curve(duration: 0.4, curve: .spring)))
}
}
}, updateQuery: { [weak self] query in
guard let strongSelf = self else {