Always show headphones button; alert if AI not configured
All checks were successful
CI / build-and-deploy (push) Successful in 24s
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:
@@ -192,6 +192,7 @@ struct BrowserView: View {
|
||||
@State private var state: BrowserState
|
||||
@State private var readerMode = false
|
||||
@State private var showPodcast = false
|
||||
@State private var showAISetupAlert = false
|
||||
|
||||
init(url: URL, title: String, claude: ClaudeService? = nil) {
|
||||
self.initialURL = url
|
||||
@@ -261,13 +262,15 @@ struct BrowserView: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
if claude != nil {
|
||||
Button { showPodcast = true } label: {
|
||||
Button {
|
||||
if claude != nil { showPodcast = true }
|
||||
else { showAISetupAlert = true }
|
||||
} label: {
|
||||
Image(systemName: "headphones")
|
||||
}
|
||||
.disabled(state.isLoading)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
||||
ShareLink(item: state.currentURL ?? initialURL) {
|
||||
Image(systemName: "square.and.arrow.up")
|
||||
@@ -285,5 +288,10 @@ struct BrowserView: View {
|
||||
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.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user