This commit is contained in:
raven 2023-01-15 23:01:30 -05:00
parent 7511ad9f11
commit 927663a2ca

View File

@ -254,12 +254,7 @@ async function handleCommand(input) {
} else { } else {
console.log(`${USERNAME}: ${input}`) console.log(`${USERNAME}: ${input}`)
} }
} }
} }
swarm.on('connection', conn => { swarm.on('connection', conn => {
@ -317,7 +312,6 @@ swarm.on('error', (err) => {
console.log('Error connecting to peer:', err); console.log('Error connecting to peer:', err);
}); });
// Join a common topic // Join a common topic
const topic = process.argv[2] ? b4a.from(process.argv[2], 'hex') : crypto.randomBytes(32) const topic = process.argv[2] ? b4a.from(process.argv[2], 'hex') : crypto.randomBytes(32)
@ -338,15 +332,11 @@ setTimeout(() => {
}) })
}, 1000); }, 1000);
// Append the boxes to the screen // Append the boxes to the screen
screen.append(mainBox); screen.append(mainBox);
screen.append(stdinBox); screen.append(stdinBox);
screen.append(sidebarBox); screen.append(sidebarBox);
// Handle input in the stdinBox // Handle input in the stdinBox
stdinBox.on('submit', (input) => { stdinBox.on('submit', (input) => {
// handle the input here // handle the input here
@ -354,13 +344,8 @@ stdinBox.on('submit', (input) => {
handleCommand(input); handleCommand(input);
// clear the input field // clear the input field
stdinBox.focus(); stdinBox.focus();
// screen.render();
}); });
// setInterval(() => {
// mainBox.scrollTo(mainBox.getScrollHeight());
// }, 1000);
stdinBox.focus(); stdinBox.focus();
// Render the screen // Render the screen
screen.render() screen.render()