[ios] [mapsme-9147] fix login popup in sharing options screen for ipad

This commit is contained in:
o.bolovintseva 2018-12-04 16:55:05 +03:00 committed by Aleksey Belousov
parent aee947d6d5
commit 3f7575effe

View file

@ -141,7 +141,7 @@ final class BookmarksSharingViewController: MWMTableViewController {
func startUploadAndPublishFlow() {
Statistics.logEvent(kStatSharingOptionsClick, withParameters: [kStatItem : kStatPublic])
performAfterValidation { [weak self] in
performAfterValidation(anchor: uploadAndPublishCell) { [weak self] in
if let self = self {
self.performSegue(withIdentifier: self.kPropertiesSegueIdentifier, sender: self)
}
@ -183,7 +183,7 @@ final class BookmarksSharingViewController: MWMTableViewController {
func uploadAndGetDirectLink() {
Statistics.logEvent(kStatSharingOptionsClick, withParameters: [kStatItem : kStatPrivate])
performAfterValidation { [weak self] in
performAfterValidation(anchor: getDirectLinkCell) { [weak self] in
guard let s = self, s.categoryId != MWMFrameworkHelper.invalidCategoryId() else {
assert(false, "categoryId must be valid")
return
@ -209,9 +209,9 @@ final class BookmarksSharingViewController: MWMTableViewController {
}
}
func performAfterValidation(action: @escaping MWMVoidBlock) {
func performAfterValidation(anchor: UIView, action: @escaping MWMVoidBlock) {
if MWMFrameworkHelper.isNetworkConnected() {
signup(anchor: view, onComplete: { success in
signup(anchor: anchor, onComplete: { success in
if success {
action()
} else {
@ -224,7 +224,8 @@ final class BookmarksSharingViewController: MWMTableViewController {
message: L("common_check_internet_connection_dialog"),
rightButtonTitle: L("downloader_retry"),
leftButtonTitle: L("cancel")) {
self.performAfterValidation(action: action)
self.performAfterValidation(anchor: anchor,
action: action)
}
}
}