[ios] update the PLacePage screen when the bookmark/track was edited in Edit

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn 2024-05-21 15:38:06 +04:00 committed by Viktor Havaka
parent 8a39e3102c
commit 7ddc3224ad
2 changed files with 19 additions and 0 deletions

View file

@ -48,6 +48,7 @@ class InfoItemViewController: UIViewController {
}
protocol PlacePageInfoViewControllerDelegate: AnyObject {
func viewWillAppear()
func didPressCall()
func didPressWebsite()
func didPressWebsiteMenu()
@ -337,6 +338,11 @@ class PlacePageInfoViewController: UIViewController {
}
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
delegate?.viewWillAppear()
}
// MARK: private
private func createInfoItem(_ info: String,
icon: UIImage?,

View file

@ -14,6 +14,15 @@ class PlacePageInteractor {
self.viewController = viewController
self.mapViewController = mapViewController
}
private func updateBookmarkIfNeeded() {
guard let bookmarkId = placePageData.bookmarkData?.bookmarkId else { return }
if !BookmarksManager.shared().hasBookmark(bookmarkId) {
presenter?.closeAnimated()
}
FrameworkHelper.updatePlacePageData()
placePageData.updateBookmarkStatus()
}
}
extension PlacePageInteractor: PlacePageInteractorProtocol {
@ -25,6 +34,10 @@ extension PlacePageInteractor: PlacePageInteractorProtocol {
// MARK: - PlacePageInfoViewControllerDelegate
extension PlacePageInteractor: PlacePageInfoViewControllerDelegate {
func viewWillAppear() {
updateBookmarkIfNeeded()
}
func didPressCall() {
MWMPlacePageManagerHelper.call(placePageData)
}