From 1d13161e9acaa9cfb43a7fa1b62a923764ebb4db Mon Sep 17 00:00:00 2001 From: Sean Edmunds Date: Thu, 10 Jul 2025 14:43:25 -0500 Subject: [PATCH] Fixing width bug --- src/pages/settings/components/Theming/BackgroundModal.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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}