Limit per server command history to 32.

This commit is contained in:
Griffin T 2020-10-27 18:19:33 +08:00
parent a4d3e7db1b
commit 6e4261b3a7

View file

@ -97,7 +97,7 @@ export default () => {
const command = e.currentTarget.value;
if (e.key === 'Enter' && command.length > 0) {
setHistory(prevHistory => [ command, ...prevHistory! ]);
setHistory(prevHistory => [ command, ...prevHistory! ].slice(0, 32));
setHistoryIndex(-1);
instance && instance.send('send command', command);