diff --git a/src/pages/settings/components/Theming/BackgroundModal.tsx b/src/pages/settings/components/Theming/BackgroundModal.tsx index 766081a..fcc66da 100644 --- a/src/pages/settings/components/Theming/BackgroundModal.tsx +++ b/src/pages/settings/components/Theming/BackgroundModal.tsx @@ -39,6 +39,7 @@ function BackgroundModal({ inUseBackgrounds: string[]; }) { const { ref, width } = useElementSize(); + const [backgroundWidth, setBackgroundWidth] = useState(width || 0); const [background, setBackground] = useState(null); const [fileName, setFileName] = useState(''); const [newFileName, setNewFileName] = useState(''); @@ -62,6 +63,11 @@ function BackgroundModal({ setIsLoading(false); } }, [debouncedSearch]); + useEffect(() => { + if (width) { + setBackgroundWidth(width); + } + }, [width]); return ( {background}