mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
Cleanup & prep for real-time interrupt
This commit is contained in:
parent
b3930d1999
commit
cc9c143927
2 changed files with 18 additions and 10 deletions
|
@ -43,12 +43,16 @@ module.exports = class UserInterruptQueue
|
|||
return this.queue.length > 0;
|
||||
}
|
||||
|
||||
display(cb) {
|
||||
displayNext(cb) {
|
||||
const interruptItem = this.queue.pop();
|
||||
if(!interruptItem) {
|
||||
return cb(null);
|
||||
}
|
||||
|
||||
return interruptItem ? this.displayWithItem(interruptItem, cb) : cb(null);
|
||||
}
|
||||
|
||||
displayWithItem(interruptItem, cb) {
|
||||
if(interruptItem.cls) {
|
||||
this.client.term.rawWrite(ANSI.clearScreen());
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue