mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-08 02:14:37 +00:00
fix(webhooks-ios): surface parse failure in lastError
The post-load assignment was a true no-op: `self.lastError = parsed.isEmpty && !result.isEmpty ? nil : nil` — both ternary branches assigned `nil`. The intent (visible from the condition shape) was to set an error message when the CLI returned text but the parser produced no webhooks. Now that branch sets a "Couldn't parse webhook list output" message which the existing banner at line 33 renders. Normal flow (parse succeeds, or empty output) still clears the error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -91,8 +91,11 @@ struct WebhooksView: View {
|
||||
self.notEnabled = false
|
||||
let parsed = Self.parse(result)
|
||||
self.webhooks = parsed
|
||||
self.lastError = parsed.isEmpty && !result.isEmpty
|
||||
? nil
|
||||
// When the CLI returned text but the parser produced nothing, the
|
||||
// user otherwise sees a silent empty list. Surface a parse-failure
|
||||
// message so they know to dig deeper.
|
||||
self.lastError = (parsed.isEmpty && !result.isEmpty)
|
||||
? "Couldn't parse webhook list output"
|
||||
: nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user