settings: set display

This commit is contained in:
James Acklin 2022-10-01 19:01:03 -04:00
parent 436f4db6b6
commit 50ed84ca97

View File

@ -41,12 +41,14 @@ const RadioOption = ({ value, label, selected }: RadioOptionProps) => (
export const AppearancePrefs = () => {
const theme = useTheme();
const state = useSettingsState.getState();
const [pref, setPref] = useState<prefType>(theme || 'auto');
useEffect(() => {
useSettingsState.getState().set((draft) => {
draft.display.theme = pref;
});
state.putEntry('display', 'theme', pref);
}, [pref]);
const handleChange = (value: string) => {