mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-28 16:04:24 -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() {
|
||||
const themes = await Promise.all(settings.themeLinks.map(async link => {
|
||||
const css = await fetch(link).then(res => res.text());
|
||||
return { ...getThemeInfo(css, link), link };
|
||||
}));
|
||||
setOnlineThemes(themes);
|
||||
const themes = await Promise.all(
|
||||
settings.themeLinks.map(async link => {
|
||||
try {
|
||||
const res = await fetch(link);
|
||||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue