Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/danxfisher/MeetEasier
Browse files Browse the repository at this point in the history
  • Loading branch information
danxfisher committed Jul 21, 2018
2 parents ffd3c28 + 5e3bd25 commit 943e1c7
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions app/ews/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module.exports = function (callback) {
context.itemsProcessed++;

if (context.itemsProcessed === context.roomAddresses.length) {
context.roomAddresses.sort(sortByRoomName);
context.roomAddresses.sort((a, b) => a.Name.toLowerCase().localeCompare(b.Name.toLowerCase()));
context.callback(context.roomAddresses);
}
};
Expand Down Expand Up @@ -138,18 +138,6 @@ module.exports = function (callback) {
return time;
}

// function to sort by room name
function sortByRoomName(a, b) {
var nameA = a.Name.toLowerCase();
var nameB = b.Name.toLowerCase();
if (nameA < nameB) //sort string ascending
return -1;
if (nameA > nameB)
return 1;
return 0; //default return value (no sorting)
}


// perform promise chain to get rooms
getListOfRooms()
.then(getRoomsInLists)
Expand Down

0 comments on commit 943e1c7

Please sign in to comment.