diff --git a/WordPress/Classes/ViewRelated/Pages/PageMenuViewModelTests.swift b/WordPress/Classes/ViewRelated/Pages/PageMenuViewModelTests.swift index d03f84b6a0ca..4ea70295de37 100644 --- a/WordPress/Classes/ViewRelated/Pages/PageMenuViewModelTests.swift +++ b/WordPress/Classes/ViewRelated/Pages/PageMenuViewModelTests.swift @@ -106,10 +106,9 @@ final class PageMenuViewModelTests: CoreDataTestCase { .map { $0.buttons } let expectedButtons: [[AbstractPostButton]] = [ [.view], - [.moveToDraft, .duplicate], + [.duplicate], [.blaze], - [.setParent, .setPostsPage], - [.trash] + [.setParent, .setPostsPage] ] expect(buttons).to(equal(expectedButtons)) } diff --git a/WordPress/Classes/ViewRelated/Post/PageMenuViewModel.swift b/WordPress/Classes/ViewRelated/Post/PageMenuViewModel.swift index fd7ad3e64d6d..06ca19c35737 100644 --- a/WordPress/Classes/ViewRelated/Post/PageMenuViewModel.swift +++ b/WordPress/Classes/ViewRelated/Post/PageMenuViewModel.swift @@ -49,7 +49,7 @@ final class PageMenuViewModel: AbstractPostMenuViewModel { private func createSecondarySection() -> AbstractPostButtonSection { var buttons = [AbstractPostButton]() - if page.status != .draft { + if page.status != .draft && isSiteHomepage { buttons.append(.moveToDraft) } @@ -106,6 +106,10 @@ final class PageMenuViewModel: AbstractPostMenuViewModel { } private func createTrashSection() -> AbstractPostButtonSection { + guard !isSiteHomepage else { + return AbstractPostButtonSection(buttons: []) + } + return AbstractPostButtonSection(buttons: [.trash]) } }