Emoji input improvements

This commit is contained in:
Ali
2022-07-22 02:12:10 +02:00
parent 3384d86415
commit 7b663a3445
28 changed files with 1311 additions and 466 deletions

View File

@@ -3,7 +3,7 @@ import Postbox
import SwiftSignalKit
func _internal_addStickerPackInteractively(postbox: Postbox, info: StickerPackCollectionInfo, items: [ItemCollectionItem], positionInList: Int? = nil) -> Signal<Void, NoError> {
func _internal_addStickerPackInteractively(postbox: Postbox, info: StickerPackCollectionInfo, items: [StickerPackItem], positionInList: Int? = nil) -> Signal<Void, NoError> {
return postbox.transaction { transaction -> Void in
let namespace: SynchronizeInstalledStickerPacksOperationNamespace?
switch info.id.namespace {
@@ -33,7 +33,12 @@ func _internal_addStickerPackInteractively(postbox: Postbox, info: StickerPackCo
} else {
updatedInfos.insert(mappedInfo, at: 0)
}
transaction.replaceItemCollectionItems(collectionId: mappedInfo.id, items: items)
var indexedItems: [ItemCollectionItem] = []
for item in items {
indexedItems.append(StickerPackItem(index: ItemCollectionItemIndex(index: Int32(indexedItems.count), id: item.index.id), file: item.file, indexKeys: item.indexKeys))
}
transaction.replaceItemCollectionItems(collectionId: mappedInfo.id, items: indexedItems)
}
transaction.replaceItemCollectionInfos(namespace: mappedInfo.id.namespace, itemCollectionInfos: updatedInfos.map { ($0.id, $0) })
}