fix(ui): P0-4 — SaaS settings page crash from paginated API response
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

listRelayTasks() expected RelayTaskInfo[] but API returns
{items:[], total:0, page:1, page_size:20}. When setTasks() received
the paginated object, tasks.map() crashed during render, triggering
the ErrorBoundary fallback "SaaS 平台加载失败".

Fix: extract .items from paginated response with Array.isArray fallback.
Also adds onError logging to ErrorBoundary wrappers for easier debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-04-10 21:42:52 +08:00
parent 34ef41c96f
commit b2d5b4075c
2 changed files with 9 additions and 2 deletions

View File

@@ -113,6 +113,9 @@ export function SettingsLayout({ onBack }: SettingsLayoutProps) {
case 'saas': return (
<ErrorBoundary
fallback={<div className="p-6 text-center text-gray-500">SaaS </div>}
onError={(err, info) => {
console.error('[Settings] SaaS page render error:', err, info.componentStack);
}}
>
<SaaSSettings />
</ErrorBoundary>
@@ -120,6 +123,9 @@ export function SettingsLayout({ onBack }: SettingsLayoutProps) {
case 'billing': return (
<ErrorBoundary
fallback={<div className="p-6 text-center text-gray-500"></div>}
onError={(err, info) => {
console.error('[Settings] Billing page render error:', err, info.componentStack);
}}
>
<PricingPage />
</ErrorBoundary>