From 9c8705033377381ed3ee8686451cbd9b5cf95aee Mon Sep 17 00:00:00 2001 From: yamanq Date: Sun, 14 Aug 2016 15:02:18 -0400 Subject: [PATCH] fix joinclass issue --- hourglass/client/profile/profile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hourglass/client/profile/profile.js b/hourglass/client/profile/profile.js index 66dcb24..83711b3 100644 --- a/hourglass/client/profile/profile.js +++ b/hourglass/client/profile/profile.js @@ -136,7 +136,8 @@ Template.profile.helpers({ return classes.find( { status: {$eq: true}, - privacy: {$eq: false} + privacy: {$eq: false}, + _id: {$nin: Meteor.user().profile.classes} }, {sort: {subscribers: -1 }}, {limit: 20} @@ -364,6 +365,7 @@ Template.profile.events({ } for (var i = 2; i < items.length; i += 3) { var item = items[i].childNodes[3]; + if(Meteor.user().profile.classes.indexOf(item.getAttribute("classid")) !== -1) continue; divs.push({ name: item.childNodes[1].childNodes[0].nodeValue, teacher: item.childNodes[3].childNodes[0].nodeValue,