fix(web): add missing loading and error states to MfaPromptBanner, Step1Identity, MobileSummaryClient
- MfaPromptBanner: silently hide on query error (non-critical advisory banner) - Step1Identity: show skeleton placeholders while blueprint list loads - MobileSummaryClient: add error state with retry button for dashboard queries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ const SNOOZE_DAYS = 7;
|
||||
* Snooze state is scoped by userId to prevent cross-user leakage on shared browsers.
|
||||
*/
|
||||
export function MfaPromptBanner() {
|
||||
const { data: mfaStatus } = trpc.user.getMfaStatus.useQuery();
|
||||
const { data: mfaStatus, isError } = trpc.user.getMfaStatus.useQuery();
|
||||
const { data: session } = useSession();
|
||||
const userId = (session?.user as { id?: string } | undefined)?.id ?? "";
|
||||
const [snoozed, setSnoozed] = useState<boolean | null>(null);
|
||||
@@ -48,8 +48,8 @@ export function MfaPromptBanner() {
|
||||
setSnoozed(true);
|
||||
}
|
||||
|
||||
// Don't render until we know the MFA status and snooze state
|
||||
if (mfaStatus === undefined || snoozed === null) return null;
|
||||
// Don't render until we know the MFA status and snooze state; silently hide on error
|
||||
if (isError || mfaStatus === undefined || snoozed === null) return null;
|
||||
// Already enabled — no banner needed
|
||||
if (mfaStatus.totpEnabled) return null;
|
||||
// Snoozed
|
||||
@@ -62,8 +62,8 @@ export function MfaPromptBanner() {
|
||||
className="flex items-center justify-between gap-4 bg-amber-50 px-4 py-2.5 text-sm text-amber-900 dark:bg-amber-900/20 dark:text-amber-200 border-b border-amber-200 dark:border-amber-700/50"
|
||||
>
|
||||
<span>
|
||||
<strong className="font-semibold">Protect your account:</strong>{" "}
|
||||
Your role has elevated permissions. We recommend enabling multi-factor authentication (MFA).
|
||||
<strong className="font-semibold">Protect your account:</strong> Your role has elevated
|
||||
permissions. We recommend enabling multi-factor authentication (MFA).
|
||||
</span>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
<Link
|
||||
|
||||
Reference in New Issue
Block a user