From 72ce7a5ad10ed2a1e0af566ad088ab9299968f3a Mon Sep 17 00:00:00 2001 From: V Date: Sat, 19 Aug 2023 01:33:39 +0200 Subject: [PATCH] themes: ignore non theme files --- src/main/ipcMain.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/ipcMain.ts b/src/main/ipcMain.ts index 625f24f8..c8e45676 100644 --- a/src/main/ipcMain.ts +++ b/src/main/ipcMain.ts @@ -53,10 +53,12 @@ async function listThemes(): Promise { 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;