Skip to content

Commit

Permalink
[ios] hide the export all button when there are no bookmarks
Browse files Browse the repository at this point in the history
Signed-off-by: Kiryl Kaveryn <[email protected]>
  • Loading branch information
kirylkaveryn authored and biodranik committed May 22, 2024
1 parent 2f1f05a commit 64c8703
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ final class BMCDefaultViewModel: NSObject {
}

private func setActions() {
actions = [.create, .exportAll]
actions = [.create]
if !manager.areAllCategoriesEmpty() {
actions.append(.exportAll)
}
}

private func setNotifications() {
Expand Down Expand Up @@ -121,8 +124,8 @@ extension BMCDefaultViewModel {

let category = categories[index]
categories.remove(at: index)
manager.deleteCategory(category.categoryId)
view?.delete(at: [IndexPath(row: index, section: section)])
manager.deleteCategory(category.categoryId)
}

func checkCategory(name: String) -> Bool {
Expand Down Expand Up @@ -165,6 +168,10 @@ extension BMCDefaultViewModel: BookmarksObserver {
reloadData()
}

func onBookmarksCategoryDeleted(_ groupId: MWMMarkGroupID) {
reloadData()
}

func onBookmarkDeleted(_: MWMMarkID) {
reloadData()
}
Expand Down

0 comments on commit 64c8703

Please sign in to comment.