mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-04-23 16:16:08 +02:00
23 lines
767 B
Swift
23 lines
767 B
Swift
import Foundation
|
|
|
|
|
|
func sgPatchEmojiKeyboardItems(_ items: [EmojiPagerContentComponent.ItemGroup]) -> [EmojiPagerContentComponent.ItemGroup] {
|
|
var items = items
|
|
let staticEmojisIndex = items.firstIndex { item in
|
|
if let groupId = item.groupId.base as? String, groupId == "static" {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
let recentEmojisIndex = items.firstIndex { item in
|
|
if let groupId = item.groupId.base as? String, groupId == "recent" {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
if let staticEmojisIndex = staticEmojisIndex {
|
|
let staticEmojiItem = items.remove(at: staticEmojisIndex)
|
|
items.insert(staticEmojiItem, at: (recentEmojisIndex ?? -1) + 1 )
|
|
}
|
|
return items
|
|
} |