mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 15:53:44 +00:00
check internet connection before calling server
This commit is contained in:
@@ -173,11 +173,18 @@ namespace Bit.App.Pages
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None)
|
||||
{
|
||||
await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequiredMessage,
|
||||
AppResources.InternetConnectionRequiredTitle);
|
||||
return;
|
||||
}
|
||||
if(string.IsNullOrWhiteSpace(Token))
|
||||
{
|
||||
await _platformUtilsService.ShowDialogAsync(
|
||||
string.Format(AppResources.ValidationFieldRequired, AppResources.VerificationCode),
|
||||
AppResources.AnErrorHasOccurred);
|
||||
return;
|
||||
}
|
||||
if(SelectedProviderType == TwoFactorProviderType.Email ||
|
||||
SelectedProviderType == TwoFactorProviderType.Authenticator)
|
||||
@@ -233,6 +240,12 @@ namespace Bit.App.Pages
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None)
|
||||
{
|
||||
await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequiredMessage,
|
||||
AppResources.InternetConnectionRequiredTitle);
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
if(showLoading)
|
||||
|
||||
Reference in New Issue
Block a user