[ios] [mapsme-8982] fix no network connection dialog in bookmark sharing

This commit is contained in:
o.bolovintseva 2018-11-27 16:48:15 +03:00 committed by Olesia Bolovintseva
parent 04a8f910f9
commit aee8dd13e4
3 changed files with 19 additions and 7 deletions

View file

@ -204,13 +204,18 @@ final class BookmarksSharingViewController: MWMTableViewController {
}
func performAfterValidation(action: @escaping MWMVoidBlock) {
MWMFrameworkHelper.checkConnectionAndPerformAction { [weak self] in
if let self = self, let view = self.view {
self.signup(anchor: view, onComplete: { success in
if success {
action()
}
})
if MWMFrameworkHelper.isNetworkConnected() {
signup(anchor: view, onComplete: { success in
if success {
action()
}
})
} else {
MWMAlertViewController.activeAlert().presentDefaultAlert(withTitle: L("common_check_internet_connection_dialog_title"),
message: L("common_check_internet_connection_dialog"),
rightButtonTitle: L("try_again"),
leftButtonTitle: L("downloader_retry")) {
self.performAfterValidation(action: action)
}
}
}

View file

@ -14,6 +14,8 @@
+ (BOOL)canUseNetwork;
+ (BOOL)isNetworkConnected;
+ (MWMMarkGroupID)invalidCategoryId;
@end

View file

@ -103,6 +103,11 @@
GetPlatform().ConnectionStatus() != Platform::EConnectionType::CONNECTION_WWAN;
}
+ (BOOL)isNetworkConnected
{
return GetPlatform().ConnectionStatus() != Platform::EConnectionType::CONNECTION_NONE;
}
+ (MWMMarkGroupID)invalidCategoryId { return kml::kInvalidMarkGroupId; }
@end