mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 05:13:29 -05:00
Fix ThemeLibrary Issue
This commit is contained in:
parent
4de91825a4
commit
3994eaf489
1 changed files with 15 additions and 1 deletions
|
@ -200,9 +200,23 @@ function ThemesTab() {
|
||||||
const [themeDir, , themeDirPending] = useAwaiter(VencordNative.themes.getThemesDir);
|
const [themeDir, , themeDirPending] = useAwaiter(VencordNative.themes.getThemesDir);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
updateThemes();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
async function updateThemes() {
|
||||||
|
await changeThemeLibraryURLs();
|
||||||
refreshLocalThemes();
|
refreshLocalThemes();
|
||||||
refreshOnlineThemes();
|
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() {
|
async function refreshLocalThemes() {
|
||||||
const themes = await VencordNative.themes.getThemesList();
|
const themes = await VencordNative.themes.getThemesList();
|
||||||
|
|
Loading…
Reference in a new issue