From 4423b06807b7eaf1e242611922a5474ffea51866 Mon Sep 17 00:00:00 2001 From: rushii <33725716+rushiiMachine@users.noreply.github.com> Date: Tue, 3 Feb 2026 22:56:09 -0800 Subject: [PATCH] fix(Settings): mpv path selector (#1641) An unnecessary default value appears to be stringifying a Promise when a separate useEffect hook is supposed to properly load the setting value. --- .../settings/components/playback/mpv-settings.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/renderer/features/settings/components/playback/mpv-settings.tsx b/src/renderer/features/settings/components/playback/mpv-settings.tsx index c54e17bee..579c6b018 100644 --- a/src/renderer/features/settings/components/playback/mpv-settings.tsx +++ b/src/renderer/features/settings/components/playback/mpv-settings.tsx @@ -36,9 +36,7 @@ export const MpvSettings = memo(() => { // const { pause } = usePlayerControls(); // const { clearQueue } = useQueueControls(); - const [mpvPath, setMpvPath] = useState( - (localSettings?.get('mpv_path') as string | undefined) || '', - ); + const [mpvPath, setMpvPath] = useState(''); const handleSetMpvPath = async (clear?: boolean) => { if (clear) { @@ -62,8 +60,8 @@ export const MpvSettings = memo(() => { useEffect(() => { const getMpvPath = async () => { if (!localSettings) return setMpvPath(''); - const mpvPath = (await localSettings.get('mpv_path')) as string; - return setMpvPath(mpvPath); + const mpvPath = (await localSettings.get('mpv_path')) as string | undefined; + return setMpvPath(mpvPath || ''); }; getMpvPath();