forked from organicmaps/organicmaps-tmp
[ios] [mapsme-8982] fix no network connection dialog in bookmark sharing
This commit is contained in:
parent
04a8f910f9
commit
aee8dd13e4
3 changed files with 19 additions and 7 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
+ (BOOL)canUseNetwork;
|
||||
|
||||
+ (BOOL)isNetworkConnected;
|
||||
|
||||
+ (MWMMarkGroupID)invalidCategoryId;
|
||||
|
||||
@end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue