From 0d28e9e9d4b1683b83ca5f8388c633beef9cb786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E7=BF=94=E5=AE=87?= Date: Tue, 19 May 2026 17:52:33 +0800 Subject: [PATCH] fix(add): surface search failure with error toast Catch block previously set hits = [] silently, so a 15s network timeout looked like "no funds matched". Now an error toast tells the user it's a network issue, distinct from "no results." P0 from 2026-05-19 code review. Co-Authored-By: Claude Opus 4.7 (1M context) --- Sources/ui/AddView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/ui/AddView.swift b/Sources/ui/AddView.swift index 7ad1f19..62384e1 100644 --- a/Sources/ui/AddView.swift +++ b/Sources/ui/AddView.swift @@ -136,7 +136,11 @@ struct AddView: View { do { hits = try await FundClient.shared.search(q) } catch { + // P0 fix (2026-05-19 review): silent swallow used to make + // a 15s network timeout look like "no funds matched". Surface + // the actual failure so users know it's network, not empty. hits = [] + ToastController.shared.error("搜索失败,请检查网络后重试") } } }