massively improved indexing performance:

cache the downloadedEmojis Set and Array
added resize image function, yet to use
the app icon and name are horizontally aligned in settings
This commit is contained in:
neon443 committed 2025-11-22 17:31:03 +00:00
1 parent 69b1edce9f
commit 98d8f083a1
5 files changed
+55 -13

No files matched your search

+12 -4
View File
@@ -131,11 +131,19 @@ class EmojiHoarder: ObservableObject {
func buildDownloadedEmojis() {
downloadedEmojis = []
downloadedEmojisArr = []
for emoji in emojis {
guard emoji.isLocal else { continue }
downloadedEmojis.insert(emoji.name)
downloadedEmojisArr.append(emoji.name)
downloadedEmojisArr = (try? JSONDecoder().decode([String].self, from: UserDefaults.standard.data(forKey: "downloadedEmojisArr") ?? Data())) ?? []
downloadedEmojis = (try? JSONDecoder().decode(Set<String>.self, from: UserDefaults.standard.data(forKey: "downloadedEmojis") ?? Data())) ?? []
if downloadedEmojis.isEmpty || downloadedEmojisArr.isEmpty {
for emoji in emojis {
guard emoji.isLocal else { continue }
downloadedEmojis.insert(emoji.name)
downloadedEmojisArr.append(emoji.name)
}
}
UserDefaults.standard.set(try! JSONEncoder().encode(downloadedEmojis), forKey: "downloadedEmojis")
UserDefaults.standard.set(try! JSONEncoder().encode(downloadedEmojisArr), forKey: "downloadedEmojisArr")
}
nonisolated
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.