aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-08-19 01:33:39 +0200
committerV <vendicated@riseup.net>2023-08-19 01:33:39 +0200
commit72ce7a5ad10ed2a1e0af566ad088ab9299968f3a (patch)
tree5e50c0368da4650df36720f854084c030ad98133 /src
parente699ea63c749a4c4af185d997a1f7588804d458f (diff)
downloadVencord-72ce7a5ad10ed2a1e0af566ad088ab9299968f3a.tar.gz
Vencord-72ce7a5ad10ed2a1e0af566ad088ab9299968f3a.tar.bz2
Vencord-72ce7a5ad10ed2a1e0af566ad088ab9299968f3a.zip
themes: ignore non theme files
Diffstat (limited to 'src')
-rw-r--r--src/main/ipcMain.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/ipcMain.ts b/src/main/ipcMain.ts
index 625f24f..c8e4567 100644
--- a/src/main/ipcMain.ts
+++ b/src/main/ipcMain.ts
@@ -53,10 +53,12 @@ async function listThemes(): Promise<UserThemeHeader[]> {
const themeInfo: UserThemeHeader[] = [];
for (const fileName of files) {
+ if (!fileName.endsWith(".css")) continue;
+
const data = await getThemeData(fileName).then(stripBOM).catch(() => null);
- if (!data) continue;
- const parsed = getThemeInfo(data, fileName);
- themeInfo.push(parsed);
+ if (data == null) continue;
+
+ themeInfo.push(getThemeInfo(data, fileName));
}
return themeInfo;