From 1a9435a3ded9c121f7464c417a19c81c3ca3f3b6 Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Sun, 28 Aug 2016 19:22:51 -0400 Subject: [PATCH] cannot confirm and approve work at same time --- hourglass/server/main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 4c5d543..2bc46dd 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -463,6 +463,13 @@ Meteor.methods({ userindex = workobject[input[1]].indexOf(Meteor.userId()); if (userindex === -1) { workobject[input[1]] = workobject[input[1]].concat(Meteor.userId()); + if (input[1] === "confirmations" && + workobject.reports.indexOf(Meteor.userId()) !== -1) { + workobject.reports.splice(userindex, 1); + } else if (input[1] === "reports" && + workobject.confirmations.indexOf(Meteor.userId()) !== -1) { + workobject.confirmations.splice(userindex, 1); + } } else { workobject[input[1]].splice(userindex, 1); }