damus

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

commit 7d49d3d9f1ada695a6b11b0d3e0a53854f137f33
parent cb1e16b1a45b7faa06d67a661944d350b641c38b
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  3 Jul 2023 12:48:25 -0700

refactor: make guard statement a bit more readible

It's a bit confusing to guard on a negative boolean expression

Diffstat:
Mdamus/Models/HomeModel.swift | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/damus/Models/HomeModel.swift b/damus/Models/HomeModel.swift @@ -154,14 +154,14 @@ class HomeModel { print("nwc: \(resp.req_id) not found in the postbox, nothing to remove [\(relay)]") } - guard resp.response.error != nil else { - print("nwc success: \(resp.response.result.debugDescription) [\(relay)]") - nwc_success(state: self.damus_state, resp: resp) + guard resp.response.error == nil else { + print("nwc error: \(resp.response)") + nwc_error(zapcache: self.damus_state.zaps, evcache: self.damus_state.events, resp: resp) return } - print("nwc error: \(resp.response)") - nwc_error(zapcache: self.damus_state.zaps, evcache: self.damus_state.events, resp: resp) + print("nwc success: \(resp.response.result.debugDescription) [\(relay)]") + nwc_success(state: self.damus_state, resp: resp) } }