pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Dont reset inprogress settings when backend loads

useDerived resets its local edit whenever initial changes. When the async loadSettings() completes it updates the store, so initial changes and the effect clears the user's toggle before they click Save. Fixing by: 1) removing the effect in useDerived that clears overwrite when initial changes; 2) calling state.reset() in Settings after applying loaded settings so the form reflects backend values without wiping in-progress edits.

Pas 126d9c0b 8cb8d158

+1 -4
-4
src/hooks/useSettingsState.ts
··· 2 2 Dispatch, 3 3 SetStateAction, 4 4 useCallback, 5 - useEffect, 6 5 useMemo, 7 6 useState, 8 7 } from "react"; ··· 14 13 initial: T, 15 14 ): [T, Dispatch<SetStateAction<T>>, () => void, boolean] { 16 15 const [overwrite, setOverwrite] = useState<T | undefined>(undefined); 17 - useEffect(() => { 18 - setOverwrite(undefined); 19 - }, [initial]); 20 16 const changed = useMemo( 21 17 () => 22 18 JSON.stringify(overwrite) !== JSON.stringify(initial) &&
+1
src/pages/Settings.tsx
··· 667 667 } else { 668 668 setCustomThemeBaseline(useThemeStore.getState().customTheme); 669 669 } 670 + state.reset(); 670 671 } 671 672 }; 672 673 loadSettings();