Cleanup
This commit is contained in:
parent
b2ff1d0a0b
commit
406ac2a270
|
@ -116,7 +116,10 @@ final class EmojiPickerViewController: UIViewController {
|
|||
searchBar.searchBarStyle = .minimal
|
||||
searchBar.placeholder = NSLocalizedString("emoji.search", comment: "")
|
||||
searchBar.searchTextField.addAction(
|
||||
UIAction { [weak self] _ in self?.viewModel.query = self?.searchBar.text ?? "" },
|
||||
UIAction { [weak self] _ in
|
||||
self?.viewModel.query = self?.searchBar.text ?? ""
|
||||
self?.collectionView.setContentOffset(.zero, animated: false)
|
||||
},
|
||||
for: .editingChanged)
|
||||
|
||||
view.addSubview(skinToneButton)
|
||||
|
|
|
@ -34,10 +34,14 @@ final public class EmojiPickerViewModel: ObservableObject {
|
|||
.assign(to: &$systemEmoji)
|
||||
|
||||
emojiPickerService.emojiUses(limit: Self.frequentlyUsedLimit)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.assignErrorsToAlertItem(to: \.alertItem, on: self)
|
||||
.print()
|
||||
.assign(to: &$emojiUses)
|
||||
|
||||
$locale.removeDuplicates().flatMap(emojiPickerService.systemEmojiAnnotationsAndTagsPublisher(locale:))
|
||||
.replaceError(with: [:])
|
||||
.assign(to: &$systemEmojiAnnotationsAndTags)
|
||||
|
||||
$customEmoji.dropFirst().combineLatest(
|
||||
$systemEmoji.dropFirst(),
|
||||
$query,
|
||||
|
@ -71,10 +75,6 @@ final public class EmojiPickerViewModel: ObservableObject {
|
|||
return emojis.filter { !$0.value.isEmpty }
|
||||
}
|
||||
.assign(to: &$emoji)
|
||||
|
||||
$locale.removeDuplicates().flatMap(emojiPickerService.systemEmojiAnnotationsAndTagsPublisher(locale:))
|
||||
.replaceError(with: [:])
|
||||
.assign(to: &$systemEmojiAnnotationsAndTags)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue