Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2019-01-28 17:14:21 +0300
committerAleksey Belousov <beloal@users.noreply.github.com>2019-01-28 17:23:36 +0300
commit4ac1866920048ad25a94d882c6331eb291938d47 (patch)
tree985b3ff268633c8166050b5b1ad15d0bf9a966ae /iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC
parent0b175d254547e1d4c63231e3566cec3ef8c177f0 (diff)
[ios][ugc] show toast when review is submitted.
Diffstat (limited to 'iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC')
-rw-r--r--iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift13
1 files changed, 12 insertions, 1 deletions
diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift
index a33e1199ff..5873df81f8 100644
--- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift
+++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCAddReview/UGCAddReviewController.swift
@@ -65,13 +65,24 @@ final class UGCAddReviewController: MWMTableViewController {
model.text = text
onSave(model)
guard let nc = navigationController else { return }
+ let onSuccess = { Toast.toast(withText: L("ugc_thanks_message_auth")).show() }
+ let onError = { Toast.toast(withText: L("ugc_thanks_message_not_auth")).show() }
+ let onComplete = { () -> Void in nc.popToRootViewController(animated: true) }
+
if MWMAuthorizationViewModel.isAuthenticated() || MWMPlatform.networkConnectionType() == .none {
+ if MWMAuthorizationViewModel.isAuthenticated() {
+ onSuccess()
+ } else {
+ onError()
+ }
nc.popViewController(animated: true)
} else {
Statistics.logEvent(kStatUGCReviewAuthShown, withParameters: [kStatFrom: kStatAfterSave])
let authVC = AuthorizationViewController(barButtonItem: navigationItem.rightBarButtonItem!,
sourceComponent: .UGC,
- completionHandler: { _ in nc.popToRootViewController(animated: true) })
+ successHandler: {_ in onSuccess()},
+ errorHandler: {_ in onError()},
+ completionHandler: {_ in onComplete()})
present(authVC, animated: true, completion: nil)
}
}