Files
2026-03-07 18:19:16 +01:00

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
}