damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 1f095b0896806816d4c9d13d3aff5adfdb79144a
parent 4f7ed36a7cccfe7a5d04d3a4182e0b0605d9ff65
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 17 Mar 2023 08:33:11 -0600

Make sure to publish progress update on main thread

Diffstat:
Mdamus/Models/ImageUploadModel.swift | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/damus/Models/ImageUploadModel.swift b/damus/Models/ImageUploadModel.swift @@ -14,7 +14,9 @@ class ImageUploadModel: NSObject, URLSessionTaskDelegate, ObservableObject { func start(img: UIImage, uploader: ImageUploader) async -> ImageUploadResult { let res = await create_image_upload_request(imageToUpload: img, imageUploader: uploader, progress: self) - progress = nil + DispatchQueue.main.async { + self.progress = nil + } return res }