damus

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

commit 3d6909bf62408d2bc2d39d6c6e3cb021e5f02533
parent ecd8b64b8bc3dfc613eb2e81038bafaef053c6f3
Author: Bryan Montz <bryanmontz@me.com>
Date:   Sun, 16 Jul 2023 08:00:52 -0500

Swift cleanup: simplify "Task.init {}" to "Task {}"

Signed-off-by: Bryan Montz <bryanmontz@me.com>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdamus/Models/HomeModel.swift | 2+-
Mdamus/Util/EventCache.swift | 2+-
Mdamus/Views/PostView.swift | 2+-
Mdamus/Views/Search/SearchingEventView.swift | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/damus/Models/HomeModel.swift b/damus/Models/HomeModel.swift @@ -305,7 +305,7 @@ class HomeModel { boost_ev_id = inner_ev.id - Task.init { + Task { guard validate_event(ev: inner_ev) == .ok else { return } diff --git a/damus/Util/EventCache.swift b/damus/Util/EventCache.swift @@ -494,7 +494,7 @@ func preload_events(state: DamusState, events: [NostrEvent]) { return } - Task.init { + Task { for plan in plans { await preload_event(plan: plan, state: state) } diff --git a/damus/Views/PostView.swift b/damus/Views/PostView.swift @@ -246,7 +246,7 @@ struct PostView: View { func handle_upload(media: MediaUpload) { let uploader = damus_state.settings.default_media_uploader - Task.init { + Task { let img = getImage(media: media) print("img size w:\(img.size.width) h:\(img.size.height)") async let blurhash = calculate_blurhash(img: img) diff --git a/damus/Views/Search/SearchingEventView.swift b/damus/Views/Search/SearchingEventView.swift @@ -48,7 +48,7 @@ struct SearchingEventView: View { self.search_state = .found_profile(pk) } } else { - Task.init { + Task { guard let nip05 = NIP05.parse(evid) else { self.search_state = .not_found return