fix downloading images 💀

make downloadimage not return a uiimage cos its not used anywhere
This commit is contained in:
neon443
2025-11-02 22:56:40 +00:00
parent f90a2c65b4
commit 29784a9a8f
4 changed files with 11 additions and 19 deletions

View File

@@ -71,15 +71,14 @@ struct Emoji: Codable, Identifiable, Hashable {
self.remoteImageURL = url
}
nonisolated
func downloadImage() async throws -> UIImage {
func downloadImage() async throws {
if let data = try? await Data(contentsOf: localImageURL),
let uiimage = UIImage(data: data) {
return uiimage
return
}
let (data, _) = try await URLSession.shared.data(from: remoteImageURL)
try! await data.write(to: localImageURL)
return UIImage(data: data)!
return
}
func deleteImage() {