mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-08 03:02:03 +01:00
db/GroupManager.js: factored out a variable
Extracted from Ray's work.
This commit is contained in:
parent
4877ec319a
commit
40c45077ef
1 changed files with 4 additions and 2 deletions
|
@ -122,7 +122,9 @@ exports.deleteGroup = function(groupID, callback)
|
||||||
if (ERR(err, callback)) return;
|
if (ERR(err, callback)) return;
|
||||||
groups = groups? groups.groupIDs : [];
|
groups = groups? groups.groupIDs : [];
|
||||||
|
|
||||||
if (groups.indexOf(groupID) === -1) {
|
let index = groups.indexOf(groupID);
|
||||||
|
|
||||||
|
if (index === -1) {
|
||||||
// it's not listed
|
// it's not listed
|
||||||
callback();
|
callback();
|
||||||
|
|
||||||
|
@ -130,7 +132,7 @@ exports.deleteGroup = function(groupID, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove from the list
|
// remove from the list
|
||||||
groups.splice(groups.indexOf(groupID), 1);
|
groups.splice(index, 1);
|
||||||
|
|
||||||
// store empty group list
|
// store empty group list
|
||||||
if (groups.length == 0) {
|
if (groups.length == 0) {
|
||||||
|
|
Loading…
Reference in a new issue