From b9ad5bc6331f60c4c8f6f1982692f4fdba4dc677 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Tue, 28 Feb 2023 21:03:17 +0100 Subject: [PATCH] Hide share button when it should not be available --- Shared/Views/ShareButton.swift | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Shared/Views/ShareButton.swift b/Shared/Views/ShareButton.swift index 0a046b60..27f47d3c 100644 --- a/Shared/Views/ShareButton.swift +++ b/Shared/Views/ShareButton.swift @@ -21,27 +21,27 @@ struct ShareButton: View { @ViewBuilder var body: some View { // TODO: this should work with other content item types - Menu { - if let video = contentItem.video, - !video.localStreamIsFile - { - if video.localStreamIsRemoteURL { - remoteURLAction - } else { - instanceActions - Divider() - if !accounts.isEmpty { - youtubeActions + if let video = contentItem.video { + Menu { + if !video.localStreamIsFile { + if video.localStreamIsRemoteURL { + remoteURLAction + } else { + instanceActions + Divider() + if !accounts.isEmpty { + youtubeActions + } } } + } label: { + label } - } label: { - label + .menuStyle(.borderlessButton) + #if os(macOS) + .frame(maxWidth: 60) + #endif } - .menuStyle(.borderlessButton) - #if os(macOS) - .frame(maxWidth: 60) - #endif } private var instanceActions: some View {