mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
check internet connection before calling server
This commit is contained in:
@@ -367,6 +367,12 @@ namespace Bit.App.Pages
|
||||
|
||||
public async Task<bool> SubmitAsync()
|
||||
{
|
||||
if(Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None)
|
||||
{
|
||||
await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequiredMessage,
|
||||
AppResources.InternetConnectionRequiredTitle);
|
||||
return false;
|
||||
}
|
||||
if(string.IsNullOrWhiteSpace(Cipher.Name))
|
||||
{
|
||||
await Page.DisplayAlert(AppResources.AnErrorHasOccurred,
|
||||
@@ -428,6 +434,12 @@ namespace Bit.App.Pages
|
||||
|
||||
public async Task<bool> DeleteAsync()
|
||||
{
|
||||
if(Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None)
|
||||
{
|
||||
await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequiredMessage,
|
||||
AppResources.InternetConnectionRequiredTitle);
|
||||
return false;
|
||||
}
|
||||
var confirmed = await _platformUtilsService.ShowDialogAsync(AppResources.DoYouReallyWantToDelete,
|
||||
null, AppResources.Yes, AppResources.Cancel);
|
||||
if(!confirmed)
|
||||
|
||||
Reference in New Issue
Block a user