mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
Resolve: System methods prev/nextArea, and prev/nextConf can cause a crash #79
This commit is contained in:
parent
fb737357f5
commit
0a629feeb0
16 changed files with 376 additions and 353 deletions
|
@ -325,23 +325,20 @@ function BBSListModule(options) {
|
|||
//
|
||||
// Key & submit handlers
|
||||
//
|
||||
quitBBSList : function() {
|
||||
self.prevMenu();
|
||||
addBBS : function(formData, extraArgs, cb) {
|
||||
self.displayAddScreen(cb);
|
||||
},
|
||||
addBBS : function() {
|
||||
self.displayAddScreen();
|
||||
},
|
||||
deleteBBS : function() {
|
||||
deleteBBS : function(formData, extraArgs, cb) {
|
||||
const entriesView = self.viewControllers.view.getView(MciViewIds.view.BBSList);
|
||||
|
||||
if(self.entries[self.selectedBBS].submitterUserId !== self.client.user.userId && !self.client.user.isSysOp()) {
|
||||
// must be owner or +op
|
||||
return;
|
||||
return cb(null);
|
||||
}
|
||||
|
||||
const entry = self.entries[self.selectedBBS];
|
||||
if(!entry) {
|
||||
return;
|
||||
return cb(null);
|
||||
}
|
||||
|
||||
self.database.run(
|
||||
|
@ -362,10 +359,12 @@ function BBSListModule(options) {
|
|||
|
||||
self.viewControllers.view.redrawAll();
|
||||
}
|
||||
|
||||
return cb(null);
|
||||
}
|
||||
);
|
||||
},
|
||||
submitBBS : function(formData) {
|
||||
submitBBS : function(formData, extraArgs, cb) {
|
||||
|
||||
let ok = true;
|
||||
[ 'BBSName', 'Sysop', 'Telnet' ].forEach( mciName => {
|
||||
|
@ -375,7 +374,7 @@ function BBSListModule(options) {
|
|||
});
|
||||
if(!ok) {
|
||||
// validators should prevent this!
|
||||
return;
|
||||
return cb(null);
|
||||
}
|
||||
|
||||
self.database.run(
|
||||
|
@ -388,13 +387,13 @@ function BBSListModule(options) {
|
|||
}
|
||||
|
||||
self.clearAddForm();
|
||||
self.displayBBSList(true);
|
||||
self.displayBBSList(true, cb);
|
||||
}
|
||||
);
|
||||
},
|
||||
cancelSubmit : function() {
|
||||
cancelSubmit : function(formData, extraArgs, cb) {
|
||||
self.clearAddForm();
|
||||
self.displayBBSList(true);
|
||||
self.displayBBSList(true, cb);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue