diff --git a/src/pages/settings/components/Theming/BackgroundModal.tsx b/src/pages/settings/components/Theming/BackgroundModal.tsx index fcc66da..859ee1d 100644 --- a/src/pages/settings/components/Theming/BackgroundModal.tsx +++ b/src/pages/settings/components/Theming/BackgroundModal.tsx @@ -39,7 +39,6 @@ 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(''); @@ -63,11 +62,7 @@ function BackgroundModal({ setIsLoading(false); } }, [debouncedSearch]); - useEffect(() => { - if (width) { - setBackgroundWidth(width); - } - }, [width]); + return ( @@ -206,7 +202,7 @@ function BackgroundModal({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', - maxWidth: backgroundWidth, + maxWidth: width, }} > {background} @@ -251,7 +247,7 @@ function BackgroundModal({ setConfirm(true); }} > - + ))}