From 3994eaf4895537b2ac9426aa39548305f3a4941c Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:25:11 -0500 Subject: [PATCH] Fix ThemeLibrary Issue --- src/components/ThemeSettings/ThemesTab.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/ThemeSettings/ThemesTab.tsx b/src/components/ThemeSettings/ThemesTab.tsx index 3175d913..18996136 100644 --- a/src/components/ThemeSettings/ThemesTab.tsx +++ b/src/components/ThemeSettings/ThemesTab.tsx @@ -200,9 +200,23 @@ function ThemesTab() { const [themeDir, , themeDirPending] = useAwaiter(VencordNative.themes.getThemesDir); useEffect(() => { + updateThemes(); + }, []); + + async function updateThemes() { + await changeThemeLibraryURLs(); refreshLocalThemes(); refreshOnlineThemes(); - }, []); + } + + async function changeThemeLibraryURLs() { + settings.themeLinks = settings.themeLinks.map(link => { + if (link.startsWith("https://themes-delta.vercel.app/api")) { + return link.replace("https://themes-delta.vercel.app/api", "https://discord-themes.com/api"); + } + return link; + }); + } async function refreshLocalThemes() { const themes = await VencordNative.themes.getThemesList();