From 2b8f1da881a69fdeba71e652e258a640eea18d2f Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 15 Nov 2022 08:50:25 +0800 Subject: [PATCH] Remove unneeded isPresented check --- .../Sources/App/Views/AudioPlayer/ExpandedPlayer.swift | 6 +----- .../Sources/App/Views/AudioPlayer/MiniPlayer.swift | 10 +--------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift index 372d8edc2..9a2aaa2bb 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedPlayer.swift @@ -14,10 +14,6 @@ @State var showVoiceSheet = false @State var tabIndex: Int = 0 - var isPresented: Bool { - audioController.itemAudioProperties != nil && audioController.state != .stopped - } - var playPauseButtonImage: String { switch audioController.state { case .playing: @@ -345,7 +341,7 @@ } public var body: some View { - if let itemAudioProperties = self.audioController.itemAudioProperties, isPresented { + if let itemAudioProperties = self.audioController.itemAudioProperties { playerContent(itemAudioProperties) .tint(.appGrayTextContrast) } else { diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift index 1747c1e67..9eb1082eb 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift @@ -20,14 +20,6 @@ self.presentingView = AnyView(presentingView) } - var isPresented: Bool { - let presented = audioController.itemAudioProperties != nil && audioController.state != .stopped - if !presented { - print("isPresented: ", audioController.itemAudioProperties, audioController.state) - } - return true // presented - } - var playPauseButtonImage: String { switch audioController.state { case .playing: @@ -162,7 +154,7 @@ public var body: some View { ZStack(alignment: .center) { presentingView - if let itemAudioProperties = self.audioController.itemAudioProperties, isPresented { + if let itemAudioProperties = self.audioController.itemAudioProperties { ZStack(alignment: .bottom) { Color.systemBackground.edgesIgnoringSafeArea(.bottom) .frame(height: expanded ? 0 : 88, alignment: .bottom)