? ViewModels => this._viewModels?.AsQueryable();
///
@@ -134,6 +141,7 @@ public partial class Merchants : ComponentBase, IAsyncDisposable
private async Task LoadDataAsync(CancellationToken cancellationToken)
{
+ using var loading = this.LoadingService.ShowLoadingIndicator();
try
{
cancellationToken.ThrowIfCancellationRequested();
@@ -192,8 +200,13 @@ public partial class Merchants : ComponentBase, IAsyncDisposable
{
if (this._persistenceContext?.HasChanges is true)
{
+ var previousMerchantId = this._selectedMerchant?.Id;
await this.DataSource.DiscardChangesAsync().ConfigureAwait(true);
await this.LoadDataAsync(this._disposeCts?.Token ?? default).ConfigureAwait(true);
+ if (previousMerchantId is { } id && this._viewModels is not null)
+ {
+ this._selectedMerchant = this._viewModels.FirstOrDefault(vm => vm.Id == id);
+ }
}
}
diff --git a/src/Web/Shared/Components/Form/AutoForm.razor b/src/Web/Shared/Components/Form/AutoForm.razor
index f8c0fd8..5862407 100644
--- a/src/Web/Shared/Components/Form/AutoForm.razor
+++ b/src/Web/Shared/Components/Form/AutoForm.razor
@@ -19,7 +19,13 @@