private async Task DeleteProfileAsync() { try { await HardwareVaultService.DeleteProfileAsync(AccessProfile.Id); await ToastService.ShowToastAsync("Hardware vault profile deleted.", ToastType.Success); await SynchronizationService.UpdateHardwareVaultProfiles(ExceptPageId); await ModalDialogService.CloseAsync(); } catch (Exception ex) { Logger.LogError(ex.Message, ex); await ToastService.ShowToastAsync(ex.Message, ToastType.Error); await ModalDialogService.CancelAsync(); } }
private async Task EditProfileAsync() { try { await ButtonSpinner.SpinAsync(async() => { await HardwareVaultService.EditProfileAsync(AccessProfile); await ToastService.ShowToastAsync("Hardware vault profile updated.", 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(); } }