fix: resolve Inquiry data rendering issue on page load
TaxBaik CI/CD / build-and-deploy (push) Successful in 49s
TaxBaik CI/CD / build-and-deploy (push) Successful in 49s
- Move MudTabs inside MudPaper always visible structure - Only render MudTabs content (with data) after isLoading becomes false - Add null/empty check in InquiryTable.OnParametersSet() - Add error handling in InquiryList data loading Previously, MudTabs would render before data loaded, causing child InquiryTable components to mount with empty Inquiries list. After data loaded, child components weren't re-rendered because Blazor didn't detect parameter changes in that scenario. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,12 @@
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
if (Inquiries == null || Inquiries.Count == 0)
|
||||
{
|
||||
filteredInquiries = [];
|
||||
return;
|
||||
}
|
||||
|
||||
filteredInquiries = string.IsNullOrEmpty(Status)
|
||||
? Inquiries
|
||||
: Inquiries.Where(x => x.Status == Status).ToList();
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<MudPaper Class="admin-surface" Elevation="0">
|
||||
@if (isLoading)
|
||||
{
|
||||
<MudProgressCircular Indeterminate="true" Class="ma-4" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudPaper Class="admin-surface" Elevation="0">
|
||||
<MudTabs Rounded="true" Elevation="0" Class="admin-tabs">
|
||||
<MudTabPanel Text="전체">
|
||||
<InquiryTable Inquiries="allInquiries" Status="" />
|
||||
@@ -40,8 +40,8 @@ else
|
||||
<InquiryTable Inquiries="allInquiries" Status="closed" />
|
||||
</MudTabPanel>
|
||||
</MudTabs>
|
||||
</MudPaper>
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
private bool isLoading = true;
|
||||
@@ -49,8 +49,18 @@ else
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var (items, _) = await InquiryClient.GetPagedAsync(1, 200);
|
||||
allInquiries = items.ToList();
|
||||
isLoading = false;
|
||||
try
|
||||
{
|
||||
var (items, _) = await InquiryClient.GetPagedAsync(1, 200);
|
||||
allInquiries = items.ToList();
|
||||
}
|
||||
catch
|
||||
{
|
||||
allInquiries = [];
|
||||
}
|
||||
finally
|
||||
{
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user