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
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user