Handle pause for text-only interruptions also
This commit is contained in:
parent
9f728a2e94
commit
ea055ab58b
|
@ -81,18 +81,28 @@ module.exports = class UserInterruptQueue
|
|||
this.client.term.rawWrite('\r\n\r\n');
|
||||
}
|
||||
|
||||
const maybePauseAndFinish = () => {
|
||||
if(interruptItem.pause) {
|
||||
this.client.currentMenuModule.pausePrompt( () => {
|
||||
return cb(null);
|
||||
});
|
||||
} else {
|
||||
return cb(null);
|
||||
}
|
||||
};
|
||||
|
||||
if(interruptItem.contents) {
|
||||
Art.display(this.client, interruptItem.contents, err => {
|
||||
if(err) {
|
||||
return cb(err);
|
||||
}
|
||||
//this.client.term.rawWrite('\r\n\r\n'); // :TODO: Prob optional based on contents vs text
|
||||
this.client.currentMenuModule.pausePrompt( () => {
|
||||
return cb(null);
|
||||
});
|
||||
maybePauseAndFinish();
|
||||
});
|
||||
} else {
|
||||
return this.client.term.write(pipeToAnsi(`${interruptItem.text}\r\n\r\n`, this.client), cb);
|
||||
this.client.term.write(pipeToAnsi(`${interruptItem.text}\r\n\r\n`, this.client), true, () => {
|
||||
maybePauseAndFinish();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue