Fix issue with ignoredUsers

This commit is contained in:
Chi Vinh Le
2017-04-19 21:06:57 +07:00
parent 6fb2a95bf2
commit 0e6b0c01fd
+3 -1
View File
@@ -84,7 +84,9 @@ const RootQuery = {
},
myIgnoredUsers: async (_, args, {user, loaders: {Users}}) => {
if (user == null) {
return [];
}
// get currentUser again since context.user was out of date when running test/graph/mutations/ignoreUser
const currentUser = (await Users.getByQuery({ids: [user.id], limit: 1}))[0];
if ( ! (currentUser && Array.isArray(currentUser.ignoresUsers) && currentUser.ignoresUsers.length)) {