private async Task SubmitAsync() { if (string.IsNullOrWhiteSpace(EmailCell.Entry.Text)) { await DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired, AppResources.EmailAddress), AppResources.Ok); return; } var request = new PasswordHintRequest { Email = EmailCell.Entry.Text }; await _deviceActionService.ShowLoadingAsync(AppResources.Submitting); var response = await _accountApiRepository.PostPasswordHintAsync(request); await _deviceActionService.HideLoadingAsync(); if (!response.Succeeded) { await DisplayAlert(AppResources.AnErrorHasOccurred, response.Errors.FirstOrDefault()?.Message, AppResources.Ok); return; } else { await DisplayAlert(null, AppResources.PasswordHintAlert, AppResources.Ok); } await Navigation.PopAsync(); }
private async Task SubmitAsync() { if (string.IsNullOrWhiteSpace(EmailCell.Entry.Text)) { await DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired, AppResources.EmailAddress), AppResources.Ok); return; } var request = new PasswordHintRequest { Email = EmailCell.Entry.Text }; _userDialogs.ShowLoading("Submitting...", MaskType.Black); var response = await _accountApiRepository.PostPasswordHintAsync(request); _userDialogs.HideLoading(); if (!response.Succeeded) { await DisplayAlert(AppResources.AnErrorHasOccurred, response.Errors.FirstOrDefault()?.Message, AppResources.Ok); return; } else { await DisplayAlert(null, "We've sent you an email with your master password hint. ", AppResources.Ok); } await Navigation.PopAsync(); }