Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

fix: integrate refreshPreflight in AiSettings to update agent chat when settings are saved

Khuram Niaze55428af2b1b
diff --git a/src/components/agent/AgentChatProvider.tsx b/src/components/agent/AgentChatProvider.tsx
index f841ccb..b624789 100644
--- a/src/components/agent/AgentChatProvider.tsx
+++ b/src/components/agent/AgentChatProvider.tsx
@@ -392,6 +392,7 @@ function useAgentChatValue(initialMessages: UIMessage[]) {
dismissInterrupted,
clear,
preflight,
+ refreshPreflight: runPreflight,
composerNonce,
panelWidth,
startResize,
diff --git a/src/components/settings/AiSettings.tsx b/src/components/settings/AiSettings.tsx
index f7b6e52..283819e 100644
--- a/src/components/settings/AiSettings.tsx
+++ b/src/components/settings/AiSettings.tsx
@@ -26,8 +26,10 @@ import { toastSuccess, toastError } from "@/lib/toast";
import { XCircle, Loader2, RefreshCw } from "lucide-react";
import { checkOllamaConnection } from "@/utils/ai.utils";
import { getUserSettings, updateAiSettings } from "@/actions/userSettings.actions";
+import { useAgentChat } from "@/components/agent/AgentChatProvider";
function AiSettings() {
+ const { isOpen: isAgentChatOpen, refreshPreflight } = useAgentChat();
const [selectedModel, setSelectedModel] = useState<AiModel>(defaultModel);
const [fetchedModels, setFetchedModels] = useState<string[]>([]);
const [isLoadingModels, setIsLoadingModels] = useState(false);
@@ -184,6 +186,7 @@ function AiSettings() {
});
if (result.success) {
toastSuccess("AI Settings saved successfully.", "Saved!");
+ if (isAgentChatOpen) void refreshPreflight();
} else {
toastError(result.message || "Failed to save AI settings.");
}