From 4c5253e9da3eb10e525fac1196c4fa3122c6b820 Mon Sep 17 00:00:00 2001
From: Maxime Jacquemin <maxime2.jacquemin@gmail.com>
Date: Thu, 17 Feb 2022 16:58:25 +0100
Subject: [PATCH] [ivette] Linter and some cleaning

---
 ivette/src/dome/main/dome.ts        |  2 +-
 ivette/src/renderer/Preferences.tsx | 15 ---------------
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/ivette/src/dome/main/dome.ts b/ivette/src/dome/main/dome.ts
index 5595324886e..8296d357d97 100644
--- a/ivette/src/dome/main/dome.ts
+++ b/ivette/src/dome/main/dome.ts
@@ -621,7 +621,7 @@ ipcMain.handle(
 
 // --------------------------------------------------------------------------
 
-ipcMain.handle('theme-color:switch', (_, theme: 'dark' | 'light') => {
+ipcMain.handle('theme-color:switch', (_evt, theme: 'dark' | 'light') => {
   // const theme = nativeTheme.shouldUseDarkColors ? 'light' : 'dark';
   nativeTheme.themeSource = theme;
   // return nativeTheme.shouldUseDarkColors;
diff --git a/ivette/src/renderer/Preferences.tsx b/ivette/src/renderer/Preferences.tsx
index 21f6a3b60b1..6a2e8777fa9 100644
--- a/ivette/src/renderer/Preferences.tsx
+++ b/ivette/src/renderer/Preferences.tsx
@@ -46,28 +46,15 @@ import * as P from 'ivette/prefs';
 // --------------------------------------------------------------------------
 
 function ThemeFields(props: P.ThemeProps) {
-  const theme = Forms.useDefined(Forms.useValid(
-    Settings.useGlobalSettings(props.theme),
-  ));
   const fontsize = Forms.useValid(
     Settings.useGlobalSettings(props.fontSize),
   );
   const wraptext = Forms.useValid(
     Settings.useGlobalSettings(props.wrapText),
   );
-  const options = P.THEMES.map(({ id, label }) => (
-    <option key={id} value={id} label={label} />
-  ));
   const { target } = props;
   return (
     <>
-      <Forms.SelectField
-        state={theme}
-        label="Theme"
-        title={`Set the color theme of ${target}`}
-      >
-        {options}
-      </Forms.SelectField>
       <Forms.SliderField
         state={fontsize}
         label="Font Size"
@@ -109,7 +96,6 @@ export default function Preferences() {
       <Forms.Section label="AST View" unfold>
         <ThemeFields
           target="Internal AST"
-          theme={P.AstTheme}
           fontSize={P.AstFontSize}
           wrapText={P.AstWrapText}
         />
@@ -117,7 +103,6 @@ export default function Preferences() {
       <Forms.Section label="Source View" unfold>
         <ThemeFields
           target="Source Code"
-          theme={P.SourceTheme}
           fontSize={P.SourceFontSize}
           wrapText={P.SourceWrapText}
         />
-- 
GitLab