From ab60e43bf14e286f4a5e590f790867045fa60a65 Mon Sep 17 00:00:00 2001 From: smartfrigde <37928912+smartfrigde@users.noreply.github.com> Date: Sun, 14 May 2023 13:51:11 +0200 Subject: [PATCH] lint --- src/themeManager/main.ts | 12 ++++++------ src/themeManager/preload.ts | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/themeManager/main.ts b/src/themeManager/main.ts index cf82fc3..89feb66 100644 --- a/src/themeManager/main.ts +++ b/src/themeManager/main.ts @@ -1,4 +1,4 @@ -import {BrowserWindow, app, ipcMain, shell, dialog} from "electron"; +import {BrowserWindow, app, dialog, ipcMain, shell} from "electron"; import {sleep} from "../utils"; import path from "path"; import fs from "fs"; @@ -141,22 +141,22 @@ export function createTManagerWindow(): void { mainWindow.webContents.reload(); }); ipcMain.on("addToDisabled", async (_event, name: string) => { - fs.appendFileSync(path.join(userDataPath, "/disabled.txt"), name + "\n"); + fs.appendFileSync(path.join(userDataPath, "/disabled.txt"), `${name}\n`); sleep(1000); }); ipcMain.on("disabled", async (e) => { e.returnValue = fs.readFileSync(path.join(userDataPath, "/disabled.txt")).toString(); }); ipcMain.on("removeFromDisabled", async (_event, name: string) => { - var e = await fs.readFileSync(path.join(userDataPath, "/disabled.txt")).toString(); + let e = await fs.readFileSync(path.join(userDataPath, "/disabled.txt")).toString(); fs.writeFileSync(path.join(userDataPath, "/disabled.txt"), e.replace(name, "")); sleep(1000); }); ipcMain.on("installBDTheme", async (_event, link: string) => { try { - var code = await (await fetch(link)).text(); - var manifest = parseBDManifest(code); - var themePath = path.join(themesFolder, manifest.name?.replace(" ", "-") + "-BD"); + let code = await (await fetch(link)).text(); + let manifest = parseBDManifest(code); + let themePath = path.join(themesFolder, `${manifest.name?.replace(" ", "-")}-BD`); if (!fs.existsSync(themePath)) { fs.mkdirSync(themePath); console.log(`Created ${manifest.name} folder`); diff --git a/src/themeManager/preload.ts b/src/themeManager/preload.ts index 09016e3..e7ca51b 100644 --- a/src/themeManager/preload.ts +++ b/src/themeManager/preload.ts @@ -1,17 +1,17 @@ import {ipcRenderer} from "electron"; import {sleep} from "../utils"; ipcRenderer.on("themeManifest", (_event, json) => { - var manifest = JSON.parse(json); + let manifest = JSON.parse(json); console.log(manifest); sleep(1000); - var e = document.getElementById("cardBox"); - var id = manifest.name.replace(" ", "-"); + let e = document.getElementById("cardBox"); + let id = manifest.name.replace(" ", "-"); e?.insertAdjacentHTML( "beforeend", `