Replace manual backend config with auto JWT auth
Some checks failed
CI / build-and-deploy (push) Failing after 6s
Some checks failed
CI / build-and-deploy (push) Failing after 6s
Device auto-registers on first launch using hardcoded backend URL and anon key (MarksAuth.swift). 90-day JWT stored in UserDefaults, refreshed transparently. No settings fields needed — ClaudeService is always active and non-optional throughout the app. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -185,16 +185,15 @@ private struct WebViewRepresentable: UIViewRepresentable {
|
||||
struct BrowserView: View {
|
||||
let initialURL: URL
|
||||
let initialTitle: String
|
||||
let claude: ClaudeService?
|
||||
let claude: ClaudeService
|
||||
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.openURL) private var openURL
|
||||
@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) {
|
||||
init(url: URL, title: String, claude: ClaudeService) {
|
||||
self.initialURL = url
|
||||
self.initialTitle = title
|
||||
self.claude = claude
|
||||
@@ -262,10 +261,7 @@ struct BrowserView: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
Button {
|
||||
if claude != nil { showPodcast = true }
|
||||
else { showAISetupAlert = true }
|
||||
} label: {
|
||||
Button { showPodcast = true } label: {
|
||||
Image(systemName: "headphones")
|
||||
}
|
||||
.disabled(state.isLoading)
|
||||
@@ -284,14 +280,7 @@ struct BrowserView: View {
|
||||
if p > 0.01 { ReadingProgress.set(url: urlStr, progress: p) }
|
||||
}
|
||||
.sheet(isPresented: $showPodcast) {
|
||||
if let 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.")
|
||||
PodcastPlayerView(articleUrl: (state.currentURL ?? initialURL).absoluteString, claude: claude)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user