[iOS] New flow for the public guide update

This commit is contained in:
Zoia Pribytkova 2019-04-29 18:45:59 +03:00 committed by Arsentiy Milchakov
parent bd200d68b0
commit 0ca59fa19b

View file

@ -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() {