Fix ThemeLibrary Issue

This commit is contained in:
thororen1234 2025-01-15 18:25:11 -05:00
parent 4de91825a4
commit 3994eaf489

View file

@ -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();