mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-29 08:24:26 -04:00
This commit is contained in:
parent
7989e81e6c
commit
71e80b7a7a
1 changed files with 14 additions and 5 deletions
|
@ -415,11 +415,20 @@ function ThemesTab() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function refreshOnlineThemes() {
|
async function refreshOnlineThemes() {
|
||||||
const themes = await Promise.all(settings.themeLinks.map(async link => {
|
const themes = await Promise.all(
|
||||||
const css = await fetch(link).then(res => res.text());
|
settings.themeLinks.map(async link => {
|
||||||
return { ...getThemeInfo(css, link), link };
|
try {
|
||||||
}));
|
const res = await fetch(link);
|
||||||
setOnlineThemes(themes);
|
if (!res.ok) throw new Error(`Failed to fetch ${link}`);
|
||||||
|
const css = await res.text();
|
||||||
|
return { ...getThemeInfo(css, link), link };
|
||||||
|
} catch (err) {
|
||||||
|
console.warn(`Theme fetch failed for ${link}:`, err);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
setOnlineThemes(themes.filter(theme => theme !== null));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onThemeLinkEnabledChange(link: string, enabled: boolean) {
|
function onThemeLinkEnabledChange(link: string, enabled: boolean) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue