mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-22 10:45:56 +02:00
* Much better flow for mciReady in relation to pausing, etc. using callbacks
This commit is contained in:
parent
44a0f87a24
commit
a15067fc21
4 changed files with 90 additions and 99 deletions
|
@ -55,15 +55,18 @@ LastCallersModule.prototype.enter = function(client) {
|
|||
}
|
||||
};
|
||||
|
||||
LastCallersModule.prototype.mciReady = function(mciData) {
|
||||
LastCallersModule.super_.prototype.mciReady.call(this, mciData);
|
||||
|
||||
LastCallersModule.prototype.mciReady = function(mciData, cb) {
|
||||
var self = this;
|
||||
var vc = self.viewControllers.lastCallers = new ViewController( { client : self.client } );
|
||||
var loginHistory;
|
||||
|
||||
async.series(
|
||||
[
|
||||
function callParentMciReady(callback) {
|
||||
LastCallersModule.super_.prototype.mciReady.call(this, mciData, function parentMciReady(err) {
|
||||
callback(err);
|
||||
});
|
||||
},
|
||||
function loadFromConfig(callback) {
|
||||
var loadOpts = {
|
||||
callingMenu : self,
|
||||
|
@ -155,10 +158,15 @@ LastCallersModule.prototype.mciReady = function(mciData) {
|
|||
|
||||
row++;
|
||||
});
|
||||
|
||||
callback(null);
|
||||
}
|
||||
],
|
||||
function complete(err) {
|
||||
self.client.log.error(err);
|
||||
if(err) {
|
||||
self.client.log.error(err);
|
||||
}
|
||||
cb(err);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue