[WIP] Stickers editor

This commit is contained in:
Ilya Laktyushin
2024-04-06 19:53:19 +04:00
parent 7c6651db34
commit ee2b7be5e2
19 changed files with 263 additions and 65 deletions

View File

@@ -147,7 +147,7 @@ private final class StickerSelectionComponent: Component {
c.dismiss(animated: true)
}
})
if controller.completion(.file(file.media, .sticker)) {
if controller.completion(.file(file, .sticker)) {
controller.dismiss(animated: true)
}
}
@@ -884,7 +884,7 @@ public class StickerPickerScreen: ViewController {
})
})
} else if let file = item.itemFile {
if controller.completion(.file(file, .sticker)) {
if controller.completion(.file(.standalone(media: file), .sticker)) {
controller.dismiss(animated: true)
}
} else if case let .staticEmoji(emoji) = item.content {
@@ -1299,7 +1299,7 @@ public class StickerPickerScreen: ViewController {
guard let self, let controller = self.controller else {
return false
}
if controller.completion(.file(fileReference.media, .sticker)) {
if controller.completion(.file(fileReference, .sticker)) {
controller.dismiss(animated: true)
}
return true
@@ -1311,7 +1311,15 @@ public class StickerPickerScreen: ViewController {
}
})
} else {
let _ = controller.completion(.file(file, .sticker))
let reference: FileMediaReference
if groupId == AnyHashable("saved") {
reference = .savedSticker(media: file)
} else if groupId == AnyHashable("recent") {
reference = .recentSticker(media: file)
} else {
reference = .standalone(media: file)
}
let _ = controller.completion(.file(reference, .sticker))
controller.dismiss(animated: true)
}
},