Add emoji search result cache

This commit is contained in:
Ali
2023-01-27 14:06:44 +01:00
parent 50ac94a2fe
commit b3140ffed9
14 changed files with 577 additions and 357 deletions

View File

@@ -103,7 +103,7 @@ final class EmojiSearchSearchBarComponent: Component {
let useOpaqueTheme: Bool
let textInputState: TextInputState
let categories: EmojiSearchCategories?
let searchTermUpdated: (String?) -> Void
let searchTermUpdated: ([String]?) -> Void
let activateTextInput: () -> Void
init(
@@ -113,7 +113,7 @@ final class EmojiSearchSearchBarComponent: Component {
useOpaqueTheme: Bool,
textInputState: TextInputState,
categories: EmojiSearchCategories?,
searchTermUpdated: @escaping (String?) -> Void,
searchTermUpdated: @escaping ([String]?) -> Void,
activateTextInput: @escaping () -> Void
) {
self.context = context
@@ -360,7 +360,7 @@ final class EmojiSearchSearchBarComponent: Component {
self.componentState?.updated(transition: .easeInOut(duration: 0.2))
if let _ = self.selectedItem, let categories = component.categories, let group = categories.groups.first(where: { $0.id == itemId }) {
component.searchTermUpdated(group.identifiers.joined(separator: ""))
component.searchTermUpdated(group.identifiers)
if let itemComponentView = itemView.view.view {
var offset = self.scrollView.contentOffset.x