Fix Ollama settings on startup + video extraction UX
AI provider: - Extract configureAIProvider() from saveSettings for reuse - Call it on app startup after sidecar is ready (was only called on Save) - Call it after first-time sidecar download completes - Sidecar now receives correct Ollama URL/model immediately Video extraction: - Hide ffmpeg console window on Windows (CREATE_NO_WINDOW flag) - Show "Extracting audio from video..." overlay with spinner during extraction - UI stays responsive while ffmpeg runs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,11 +52,7 @@ export async function loadSettings(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveSettings(s: AppSettings): Promise<void> {
|
||||
settings.set(s);
|
||||
await invoke('save_settings', { settings: s });
|
||||
|
||||
// Configure the AI provider in the Python sidecar
|
||||
export async function configureAIProvider(s: AppSettings): Promise<void> {
|
||||
const configMap: Record<string, Record<string, string>> = {
|
||||
openai: { api_key: s.openai_api_key, model: s.openai_model },
|
||||
anthropic: { api_key: s.anthropic_api_key, model: s.anthropic_model },
|
||||
@@ -68,7 +64,15 @@ export async function saveSettings(s: AppSettings): Promise<void> {
|
||||
try {
|
||||
await invoke('ai_configure', { provider: s.ai_provider, config });
|
||||
} catch {
|
||||
// Sidecar may not be running yet — provider will be configured on first use
|
||||
// Sidecar may not be running yet
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveSettings(s: AppSettings): Promise<void> {
|
||||
settings.set(s);
|
||||
await invoke('save_settings', { settings: s });
|
||||
|
||||
// Configure the AI provider in the Python sidecar
|
||||
await configureAIProvider(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user