mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-03-11 13:26:17 +00:00
a lot of updates
grid view for downloaded emojis shared instance of EmojiHoarder nonisolated static localEmojiDB var deleteallstickers is @MainActor
This commit is contained in:
@@ -12,8 +12,9 @@ import UniformTypeIdentifiers
|
||||
import Haptics
|
||||
|
||||
class EmojiHoarder: ObservableObject {
|
||||
static let shared: EmojiHoarder = EmojiHoarder()
|
||||
static let container = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.neon443.StickerSlack")!.appendingPathComponent("Library", conformingTo: .directory)
|
||||
static let localEmojiDB: URL = EmojiHoarder.container.appendingPathComponent("_localEmojiDB.json", conformingTo: .fileURL)
|
||||
nonisolated static let localEmojiDB: URL = EmojiHoarder.container.appendingPathComponent("_localEmojiDB.json", conformingTo: .fileURL)
|
||||
private let endpoint: URL = URL(string: "https://cachet.dunkirk.sh/emojis")!
|
||||
private let encoder = JSONEncoder()
|
||||
private let decoder = JSONDecoder()
|
||||
@@ -46,6 +47,7 @@ class EmojiHoarder: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func deleteAllStickers() {
|
||||
for i in emojis.indices {
|
||||
guard downloadedEmojis.contains(emojis[i].name) else { continue }
|
||||
|
||||
Reference in New Issue
Block a user