private async Task CreateProfileAsync() { try { await Button.SpinAsync(async() => { await HardwareVaultService.CreateProfileAsync(AccessProfile); await ToastService.ShowToastAsync("Hardware vault profile created.", ToastType.Success); await ModalDialogClose(); }); } catch (Exception ex) { Logger.LogError(ex.Message); await ToastService.ShowToastAsync(ex.Message, ToastType.Error); await ModalDialogCancel(); } }
private async Task CreateProfileAsync() { try { await ButtonSpinner.SpinAsync(async() => { await HardwareVaultService.CreateProfileAsync(AccessProfile); await ToastService.ShowToastAsync("Hardware vault profile created.", ToastType.Success); await SynchronizationService.UpdateHardwareVaultProfiles(ExceptPageId); await ModalDialogService.CloseAsync(); }); } catch (Exception ex) { Logger.LogError(ex.Message); await ToastService.ShowToastAsync(ex.Message, ToastType.Error); await ModalDialogService.CancelAsync(); } }