fix: admin pages stuck on infinite loading - reset data fields when auth transitions
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m36s

Symptoms: After login, admin pages showed loading spinner forever. Root cause:
OnInitializedAsync in 11 admin pages (Dashboard, Blog, Inquiries, Clients,
Announcements, FAQs, TaxProfiles, ConsultingActivities, TaxFilingSchedules,
Contracts, RevenueTrackings) checked AuthStateTask and loaded data only if
authState.User.Identity?.IsAuthenticated == true. If that condition was ever
false (e.g., transient auth state resolution timing), the page never reset
its data collection from null → []. AdminDataPanel uses "Loading={item == null}"
as its loading predicate, so null persisted indefinitely.

Fix: Always reset the data collection, whether the auth check passes or fails:
- AuthStateTask != null && IsAuthenticated == true: load data (existing)
- AuthStateTask != null && IsAuthenticated == false: set data = [] (new else)
- AuthStateTask == null: set data = [] (new else)

This ensures AdminDataPanel's "Loading" condition becomes false on all code
paths, not just the success case.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 10:53:45 +09:00
parent ea447495d3
commit 6508282732
11 changed files with 91 additions and 0 deletions
@@ -147,6 +147,14 @@
{
await LoadAsync();
}
else
{
clients = [];
}
}
else
{
clients = [];
}
}