Esempio n. 1
0
        private async Task EditAccoountOtpAsync()
        {
            try
            {
                await ButtonSpinner.SpinAsync(async() =>
                {
                    var vaults = await SharedAccountService.EditSharedAccountOtpAsync(Account, AccountOtp);
                    RemoteDeviceConnectionsService.StartUpdateHardwareVaultAccounts(vaults);
                    await SynchronizationService.UpdateSharedAccounts(ExceptPageId);
                    await ToastService.ShowToastAsync("Account OTP updated.", ToastType.Success);
                    await ModalDialogService.CloseAsync();
                });
            }
            catch (IncorrectOtpException ex)
            {
                ValidationErrorMessage.DisplayError(nameof(SharedAccount.OtpSecret), ex.Message);
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                await ToastService.ShowToastAsync(ex.Message, ToastType.Error);

                await ModalDialogService.CancelAsync();
            }
        }