More performance updates

This commit is contained in:
Sean Edmunds
2026-01-09 12:45:40 -06:00
parent 3307bcefc9
commit 924b42a567
31 changed files with 227 additions and 174 deletions

View File

@@ -33,11 +33,7 @@ export function Themes() {
const allThemes: Theme[] = allThemeData?.filter((a: Theme) =>
a.name.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
);
const {
data: backgroundData,
isFetched: backgroundDataIsFetched,
isFetching: backgroundDataIsFetching,
} = useQueryAPI({
const { data: backgroundData, isFetching: backgroundDataIsFetching } = useQueryAPI({
endpoint: backgroundsEndpoint,
});
const { data: themePlaylistData } = useQueryAPI({
@@ -50,7 +46,9 @@ export function Themes() {
backgroundModalOpened,
{ open: openBackgroundModal, close: closeBackgroundModal },
] = useDisclosure(false);
const [backgroundList, setBackgroundList] = useState<string[]>(['None']);
const backgroundList = backgroundData
? ['None', ...backgroundData.sort((a: string, b: string) => a.localeCompare(b))]
: ['None'];
const inUseBackgrounds: string[] = [
...new Set(
allThemes
@@ -76,6 +74,7 @@ export function Themes() {
textShadowsEnabled: 0,
appShadowsEnabled: 0,
});
const [isLoading, setIsLoading] = useState(false);
const [isNew, setIsNew] = useState(false);
const navigate = useNavigate();
@@ -93,15 +92,6 @@ export function Themes() {
openThemeModal();
};
useEffect(() => {
if (backgroundData && backgroundDataIsFetched) {
setBackgroundList([
'None',
...backgroundData.sort((a: string, b: string) => a.localeCompare(b)),
]);
}
}, [backgroundData, backgroundDataIsFetched]);
useEffect(() => {
if (debouncedSearch === searchValue) {
setIsLoading(false);