Fix @Published property being changed on background thread

This commit is contained in:
Shadowfacts 2023-01-14 11:28:33 -05:00
parent 937afc0dfd
commit 37563b6afd
1 changed files with 3 additions and 1 deletions

View File

@ -321,7 +321,9 @@ class MastodonController: ObservableObject {
let request = Client.getCustomEmoji() let request = Client.getCustomEmoji()
run(request) { (response) in run(request) { (response) in
if case let .success(emojis, _) = response { if case let .success(emojis, _) = response {
DispatchQueue.main.async {
self.customEmojis = emojis self.customEmojis = emojis
}
completion(emojis) completion(emojis)
} else { } else {
completion([]) completion([])