1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Remove nonsense ref

This commit is contained in:
Marcos Rios 2024-02-22 23:55:07 -03:00
parent 3522f6c038
commit ac9d347a26
No known key found for this signature in database
GPG key ID: BDCAE71F56B79383

View file

@ -105,8 +105,6 @@ export function SettingsPage() {
const setTheme = useThemeStore((s) => s.setTheme); const setTheme = useThemeStore((s) => s.setTheme);
const previewTheme = usePreviewThemeStore((s) => s.previewTheme) ?? "default"; const previewTheme = usePreviewThemeStore((s) => s.previewTheme) ?? "default";
const setPreviewTheme = usePreviewThemeStore((s) => s.setPreviewTheme); const setPreviewTheme = usePreviewThemeStore((s) => s.setPreviewTheme);
const activeThemeRef = useRef(activeTheme);
activeThemeRef.current = activeTheme;
const appLanguage = useLanguageStore((s) => s.language); const appLanguage = useLanguageStore((s) => s.language);
const setAppLanguage = useLanguageStore((s) => s.setLanguage); const setAppLanguage = useLanguageStore((s) => s.setLanguage);
@ -147,11 +145,10 @@ export function SettingsPage() {
enableThumbnails, enableThumbnails,
); );
// Reset the preview theme when the settings page is unmounted
useEffect( useEffect(
() => () => { () => () => {
setPreviewTheme( setPreviewTheme(null);
activeThemeRef.current === "default" ? null : activeThemeRef.current,
);
}, },
[setPreviewTheme], [setPreviewTheme],
); );