LT-117: Remove the user from reviewers when session timeout
This commit is contained in:
parent
8ee2eaf644
commit
feb7f0972c
@ -62,7 +62,9 @@ Template.lesionTrackerLayout.onCreated(function() {
|
||||
clearInterval(handle);
|
||||
// Close the dialog
|
||||
dialog.css('display', 'none');
|
||||
|
||||
|
||||
// Remove reviewers info for the user
|
||||
Meteor.call('removeUserFromReviewers', Meteor.userId());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -89,7 +89,7 @@ WorklistTabs.find().observe({
|
||||
removed: function(tab) {
|
||||
var contentId = tab.contentid;
|
||||
var timepointIds = ViewerData[contentId].timepointIds;
|
||||
if (timepointIds.length > 0) {
|
||||
if (timepointIds && timepointIds.length > 0) {
|
||||
timepointIds.forEach(function(timepointId) {
|
||||
// Remove the current user from Reviewers
|
||||
Meteor.call('removeReviewer', timepointId);
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
Meteor.methods({
|
||||
setReviewer: function (studyInstanceUid) {
|
||||
if (!studyInstanceUid) {
|
||||
return;
|
||||
}
|
||||
var study = Studies.findOne({
|
||||
studyInstanceUid: studyInstanceUid
|
||||
});
|
||||
@ -45,6 +48,9 @@ Meteor.methods({
|
||||
},
|
||||
|
||||
removeReviewer: function (timepointId) {
|
||||
if (!timepointId) {
|
||||
return;
|
||||
}
|
||||
var reviewerTimepoint = Reviewers.findOne({timepointId: timepointId});
|
||||
if (!reviewerTimepoint || !reviewerTimepoint.reviewers) {
|
||||
return;
|
||||
@ -58,6 +64,9 @@ Meteor.methods({
|
||||
},
|
||||
|
||||
removeUserFromReviewers: function(userId) {
|
||||
if (!userId) {
|
||||
return;
|
||||
}
|
||||
Reviewers.find().map(function (timepoint) {
|
||||
Reviewers.update({_id: timepoint._id}, {"$pull": {"reviewers": {"userId": userId}}});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user