Initial sync up with master after Prettier
This commit is contained in:
@@ -9,18 +9,18 @@ const {
|
||||
const { Errors } = require('./enig_error.js');
|
||||
|
||||
// deps
|
||||
const async = require('async');
|
||||
const _ = require('lodash');
|
||||
const async = require('async');
|
||||
const _ = require('lodash');
|
||||
|
||||
exports.moduleInfo = {
|
||||
name : 'Who\'s Online',
|
||||
desc : 'Who is currently online',
|
||||
author : 'NuSkooler',
|
||||
packageName : 'codes.l33t.enigma.whosonline'
|
||||
name: "Who's Online",
|
||||
desc: 'Who is currently online',
|
||||
author: 'NuSkooler',
|
||||
packageName: 'codes.l33t.enigma.whosonline',
|
||||
};
|
||||
|
||||
const MciViewIds = {
|
||||
onlineList : 1,
|
||||
onlineList: 1,
|
||||
};
|
||||
|
||||
exports.getModule = class WhosOnlineModule extends MenuModule {
|
||||
@@ -30,19 +30,25 @@ exports.getModule = class WhosOnlineModule extends MenuModule {
|
||||
|
||||
mciReady(mciData, cb) {
|
||||
super.mciReady(mciData, err => {
|
||||
if(err) {
|
||||
if (err) {
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
async.series(
|
||||
[
|
||||
(next) => {
|
||||
next => {
|
||||
return this.prepViewController('online', 0, mciData.menu, next);
|
||||
},
|
||||
(next) => {
|
||||
const onlineListView = this.viewControllers.online.getView(MciViewIds.onlineList);
|
||||
if(!onlineListView) {
|
||||
return cb(Errors.MissingMci(`Missing online list MCI ${MciViewIds.onlineList}`));
|
||||
next => {
|
||||
const onlineListView = this.viewControllers.online.getView(
|
||||
MciViewIds.onlineList
|
||||
);
|
||||
if (!onlineListView) {
|
||||
return cb(
|
||||
Errors.MissingMci(
|
||||
`Missing online list MCI ${MciViewIds.onlineList}`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const onlineList = getActiveConnectionList(UserVisibleConnections).slice(0, onlineListView.height).map(
|
||||
@@ -52,11 +58,14 @@ exports.getModule = class WhosOnlineModule extends MenuModule {
|
||||
onlineListView.setItems(onlineList);
|
||||
onlineListView.redraw();
|
||||
return next(null);
|
||||
}
|
||||
},
|
||||
],
|
||||
err => {
|
||||
if(err) {
|
||||
this.client.log.error( { error : err.message }, 'Error loading who\'s online');
|
||||
if (err) {
|
||||
this.client.log.error(
|
||||
{ error: err.message },
|
||||
"Error loading who's online"
|
||||
);
|
||||
}
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user