Skip to content
Snippets Groups Projects
Commit cd402138 authored by Loïc Correnson's avatar Loïc Correnson Committed by Michele Alberti
Browse files

[ivette] no more need to clear history

parent 03aed561
No related branches found
No related tags found
No related merge requests found
......@@ -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 === '');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment