From 69250d0ae82886df8a79d96b10da4e66e015d7be Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Sun, 6 Sep 2015 03:10:55 +0200 Subject: Show avatars in search results Fixes #265 --- client/components/users/userAvatar.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client/components/users') diff --git a/client/components/users/userAvatar.js b/client/components/users/userAvatar.js index 2b9ac84b..04add0a6 100644 --- a/client/components/users/userAvatar.js +++ b/client/components/users/userAvatar.js @@ -2,7 +2,13 @@ Meteor.subscribe('my-avatars'); Template.userAvatar.helpers({ userData() { - return Users.findOne(this.userId, { + // We need to handle a special case for the search results provided by the + // `matteodem:easy-search` package. Since these results gets published in a + // separate collection, and not in the standard Meteor.Users collection as + // expected, we use a component parameter ("property") to distinguish the + // two cases. + const userCollection = this.esSearch ? ESSearchResults : Users; + return userCollection.findOne(this.userId, { fields: { profile: 1, username: 1, -- cgit v1.2.3-1-g7c22