diff options
author | Zoia Pribytkova <niakris90@gmail.com> | 2019-04-29 18:45:59 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-05-08 16:49:33 +0300 |
commit | 0ca59fa19b09882c878b2daa39fc75375e5ef1ed (patch) | |
tree | ee257762d287038bdf1e3fd92ed618f3105131fe /iphone | |
parent | bd200d68b05136f21e1b5c9da8154c697a71bb06 (diff) |
[iOS] New flow for the public guide update
Diffstat (limited to 'iphone')
-rw-r--r-- | iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift index 77ab764cb6..67cd9a9949 100644 --- a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift @@ -158,12 +158,30 @@ final class BookmarksSharingViewController: MWMTableViewController { } private func updatePublic() { - MWMAlertViewController.activeAlert().presentDefaultAlert(withTitle: L("any_access_update_alert_title"), - message: L("any_access_update_alert_message"), - rightButtonTitle: L("any_access_update_alert_update"), - leftButtonTitle: L("cancel")) { - self.uploadAndPublish(update: true) + let updateAction = { [unowned self] in + self.performAfterValidation(anchor: self.uploadAndPublishCell) { [weak self] in + guard let self = self else { return } + if self.category.title.isEmpty || self.category.detailedAnnotation.isEmpty { + self.showMalformedDataError() + return + } + if (self.category.trackCount + self.category.bookmarksCount < 3) { + MWMAlertViewController + .activeAlert() + .presentInfoAlert(L("error_public_not_enought_title"), + text: L("error_public_not_enought_subtitle")) + return + } + self.uploadAndPublish(update: true) + } } + MWMAlertViewController + .activeAlert() + .presentDefaultAlert(withTitle: L("any_access_update_alert_title"), + message: L("any_access_update_alert_message"), + rightButtonTitle: L("any_access_update_alert_update"), + leftButtonTitle: L("cancel"), + rightButtonAction: updateAction) } private func updateDirectLink() { |