From f5360e9393f7a4cfeaa53f91c46b16a5924ef53f Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Fri, 20 Dec 2019 07:49:02 -0600 Subject: [PATCH] fix: timeline not showing when set to public (#37937) --- api-server/common/models/user.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api-server/common/models/user.js b/api-server/common/models/user.js index 7ff1db25c0..ecf56f0bbb 100644 --- a/api-server/common/models/user.js +++ b/api-server/common/models/user.js @@ -796,7 +796,17 @@ export default function(User) { ...user, about: showAbout ? about : '', calendar: showHeatMap ? calendar : {}, - completedChallenges: showCerts && showTimeLine ? completedChallenges : [], + completedChallenges: (function() { + if (showTimeLine) { + return showCerts + ? completedChallenges + : completedChallenges.filter( + ({ challengeType }) => challengeType !== 7 + ); + } else { + return []; + } + })(), isDonating: showDonation ? isDonating : null, location: showLocation ? location : '', name: showName ? name : '',