mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 05:12:38 +02:00
Fixes #1018 Remove the sync useEffect that copied preferences into local state, along with the savingRef guard that prevented mid-save overwrites. Instead, pass key={searchSpaceId} on the LLMRoleManager component so React remounts the form with correct initial state whenever the search space changes — no extra re-render, no effect dependency array. Changes: - llm-role-manager.tsx: remove useEffect + useRef + savingRef pattern; drop useEffect and useRef from imports (now only useCallback, useState) - search-space-settings-dialog.tsx: add key={searchSpaceId} to <LLMRoleManager> so the component remounts on search-space change Before: useEffect synced preferences → assignments on each preference update, with savingRef to avoid overwriting an in-flight save. After: React remounts the component with correct initial state from the preferences selector; no mid-save race possible. |
||
|---|---|---|
| .. | ||
| agent-model-manager.tsx | ||
| buy-pages-content.tsx | ||
| buy-tokens-content.tsx | ||
| general-settings-manager.tsx | ||
| image-model-manager.tsx | ||
| llm-role-manager.tsx | ||
| more-pages-content.tsx | ||
| prompt-config-manager.tsx | ||
| roles-manager.tsx | ||
| search-space-settings-dialog.tsx | ||
| settings-dialog.tsx | ||
| team-dialog.tsx | ||
| team-memory-manager.tsx | ||
| user-settings-dialog.tsx | ||
| vision-model-manager.tsx | ||