Always show headphones button; alert if AI not configured
All checks were successful
CI / build-and-deploy (push) Successful in 24s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Krishna Kumar
2026-05-22 14:04:24 -05:00
parent db5092ce02
commit 9f0a10d228

View File

@@ -192,6 +192,7 @@ struct BrowserView: View {
@State private var state: BrowserState @State private var state: BrowserState
@State private var readerMode = false @State private var readerMode = false
@State private var showPodcast = false @State private var showPodcast = false
@State private var showAISetupAlert = false
init(url: URL, title: String, claude: ClaudeService? = nil) { init(url: URL, title: String, claude: ClaudeService? = nil) {
self.initialURL = url self.initialURL = url
@@ -261,13 +262,15 @@ struct BrowserView: View {
Spacer() Spacer()
if claude != nil { Button {
Button { showPodcast = true } label: { if claude != nil { showPodcast = true }
Image(systemName: "headphones") else { showAISetupAlert = true }
} } label: {
.disabled(state.isLoading) Image(systemName: "headphones")
Spacer()
} }
.disabled(state.isLoading)
Spacer()
ShareLink(item: state.currentURL ?? initialURL) { ShareLink(item: state.currentURL ?? initialURL) {
Image(systemName: "square.and.arrow.up") Image(systemName: "square.and.arrow.up")
@@ -285,5 +288,10 @@ struct BrowserView: View {
PodcastPlayerView(articleUrl: (state.currentURL ?? initialURL).absoluteString, claude: claude) PodcastPlayerView(articleUrl: (state.currentURL ?? initialURL).absoluteString, claude: claude)
} }
} }
.alert("AI Not Configured", isPresented: $showAISetupAlert) {
Button("OK") {}
} message: {
Text("Add your Backend URL and API Key in Settings to use podcast generation.")
}
} }
} }