From cd402138cd69944ec084bb8ee7e22647e1045af1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr>
Date: Wed, 10 Jun 2020 23:43:26 +0200
Subject: [PATCH] [ivette] no more need to clear history

---
 ivette/src/renderer/Controller.tsx | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/ivette/src/renderer/Controller.tsx b/ivette/src/renderer/Controller.tsx
index 01d73e3cb14..699fa98dc8a 100644
--- a/ivette/src/renderer/Controller.tsx
+++ b/ivette/src/renderer/Controller.tsx
@@ -169,17 +169,10 @@ const editor = new RichTextBuffer();
 const RenderConsole = () => {
   const scratch = React.useRef([] as string[]);
   const [cursor, setCursor] = React.useState(-1);
-  const [H0, setH0] = Dome.useState('Controller.history', []);
+  const [history, setHistory] = Dome.useState('Controller.history', []);
   const [isEmpty, setEmpty] = React.useState(true);
   const [noTrash, setNoTrash] = React.useState(true);
 
-  // Cope with merge settings that keeps previous array entries (BUG in DOME)
-  const history = Array.isArray(H0) ? H0.filter((h) => h !== '') : [];
-  const setHistory = (hs: string[]) => {
-    const n = hs.length;
-    setH0(n < 50 ? hs.concat(Array(50 - n).fill('')) : hs);
-  };
-
   Dome.useEmitter(editor, 'change', () => {
     const cmd = editor.getValue().trim();
     setEmpty(cmd === '');
-- 
GitLab