Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.
TypeScript
fix(KB): silent maybe-later error + redundant prompt-state refetches (PR #899 review)
Jake Turner9a684a5e6288
diff --git a/admin/inertia/components/chat/KbPolicyPromptBanner.tsx b/admin/inertia/components/chat/KbPolicyPromptBanner.tsxindex 3daa6545..b2fd99b9 100644--- a/admin/inertia/components/chat/KbPolicyPromptBanner.tsx+++ b/admin/inertia/components/chat/KbPolicyPromptBanner.tsx@@ -37,6 +37,7 @@ export default function KbPolicyPromptBanner() {const { data: promptState } = useQuery({queryKey: ['kbPolicyPromptState'],queryFn: () => api.getKbPolicyPromptState(),+ staleTime: Infinity,})const indexNowMutation = useMutation({@@ -72,6 +73,12 @@ export default function KbPolicyPromptBanner() {queryClient.invalidateQueries({ queryKey: ['kbPolicyPromptState'] })queryClient.invalidateQueries({ queryKey: ['ingestPolicy'] })},+ onError: (error: any) => {+ addNotification({+ type: 'error',+ message: error?.message || 'Could not save your choice. Try again.',+ })+ },})if (!promptState?.shouldPrompt) return null