Skip to content

Commit

Permalink
only add site icon menu if user is admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Momo Ozawa committed Jan 12, 2024
1 parent 1140560 commit e9a47fb
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ extension SitePickerViewController {
}

private func makeSecondarySection() -> UIMenu {
UIMenu(options: .displayInline, children: [
MenuItem.siteTitle({ [weak self] in self?.siteTitleTapped() }).toAction,
UIMenu(title: Strings.siteIcon, image: UIImage(systemName: "photo.circle"), children: [
makeSiteIconMenu() ?? UIMenu()
])
])
var menuItems: [UIMenuElement] = [
MenuItem.siteTitle({ [weak self] in self?.siteTitleTapped() }).toAction
]
if siteIconShouldAllowDroppedImages() {
menuItems.append(
UIMenu(title: Strings.siteIcon, image: UIImage(systemName: "photo.circle"), children: [
makeSiteIconMenu() ?? UIMenu()
])
)
}
return UIMenu(options: .displayInline, children: menuItems)
}

private func makeTertiarySection() -> UIMenu {
Expand Down

0 comments on commit e9a47fb

Please sign in to comment.