refactor: make guard statement a bit more readible
It's a bit confusing to guard on a negative boolean expression
This commit is contained in:
@@ -154,14 +154,14 @@ class HomeModel {
|
|||||||
print("nwc: \(resp.req_id) not found in the postbox, nothing to remove [\(relay)]")
|
print("nwc: \(resp.req_id) not found in the postbox, nothing to remove [\(relay)]")
|
||||||
}
|
}
|
||||||
|
|
||||||
guard resp.response.error != nil else {
|
guard resp.response.error == nil else {
|
||||||
print("nwc success: \(resp.response.result.debugDescription) [\(relay)]")
|
print("nwc error: \(resp.response)")
|
||||||
nwc_success(state: self.damus_state, resp: resp)
|
nwc_error(zapcache: self.damus_state.zaps, evcache: self.damus_state.events, resp: resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
print("nwc error: \(resp.response)")
|
print("nwc success: \(resp.response.result.debugDescription) [\(relay)]")
|
||||||
nwc_error(zapcache: self.damus_state.zaps, evcache: self.damus_state.events, resp: resp)
|
nwc_success(state: self.damus_state, resp: resp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user