fix: certification to private on private timeline (#45562)

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Shaun Hamilton
2022-09-28 19:30:22 +01:00
committed by GitHub
parent 926dd9839a
commit 73c3edb56a
5 changed files with 17 additions and 1 deletions

View File

@@ -391,7 +391,7 @@ function createShowCert(app) {
]
});
}
const { isLocked, showCerts, showName } = user.profileUI;
const { isLocked, showCerts, showName, showTimeLine } = user.profileUI;
if (!user.name) {
return res.json({
@@ -451,6 +451,18 @@ function createShowCert(app) {
});
}
if (!showTimeLine) {
return res.json({
messages: [
{
type: 'info',
message: 'flash.timeline-private',
variables: { username: username }
}
]
});
}
if (user[certType]) {
const { completedChallenges = [] } = user;
const certChallenge = _.find(