Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
the-AjK committed Apr 9, 2018
2 parents a9c2cab + 28c95ec commit 3aeb289
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,10 @@ exports.getMenuSuggestions = (cb) => {
for (let j = 0; j < m.firstCourse.items.length; j++) {
const fc = m.firstCourse.items[j];
fcs.push(fc.value);
condiments.concat(fc.condiments);
condiments = condiments.concat(fc.condiments);
}
scs.concat(m.secondCourse.items);
sideDishes.concat(m.secondCourse.sideDishes);
scs = scs.concat(m.secondCourse.items);
sideDishes = sideDishes.concat(m.secondCourse.sideDishes);
}
cb(null, {
fc: removeDuplicates(fcs),
Expand Down
8 changes: 4 additions & 4 deletions src/telegram/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ bot.mention(['@tables', '@table'], (ctx) => {
if (mention == 'table') {
//find user table and broadcast the message
for (let i = 0; i < orders.length; i++) {

if (orders[i].owner._id.equals(ctx.session.user._id)) {
let orderOwner = orders[i].owner._id.toString(),
user = ctx.session.user._id.toString();
if ( orderOwner === user) {
userHasOrdered = true;
const userTableName = orders[i].table.name;
for (let j = 0; j < orders.length; j++) {
if (!orders[j].owner._id.equals(ctx.session.user._id) &&
orders[j].table.name == userTableName) {
if (orders[j].table.name == userTableName && orderOwner != user) {
bot.telegram.sendMessage(orders[j].owner.telegram.id, message, {
parse_mode: "markdown"
});
Expand Down

0 comments on commit 3aeb289

Please sign in to comment.