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:
Alan Wizemann
2026-05-01 14:11:25 +02:00
parent b66ed7e8d7
commit bd05e01d1c
+5 -2
View File
@@ -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
}