From cb2fefef1972560f50936601801e40349700d857 Mon Sep 17 00:00:00 2001 From: Cleo Date: Mon, 1 May 2023 15:42:27 +0000 Subject: [PATCH] Fixing post visibility patch Co-authored-by: Laura Hausmann --- packages/client/src/components/MkPostForm.vue | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index f16d1775a..1e8d363d8 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -462,15 +462,21 @@ if ( props.reply && ["home", "followers", "specified"].includes(props.reply.visibility) ) { - visibility = props.reply.visibility; - if (props.reply.visibility === "specified") { - os.api("users/show", { - userIds: props.reply.visibleUserIds.filter( - (uid) => uid !== $i.id && uid !== props.reply.userId - ), - }).then((users) => { - users.forEach(pushVisibleUser); - }); + if (props.reply.visibility === 'home' && visibility === 'followers') { + visibility = 'followers'; + } else if (['home', 'followers'].includes(props.reply.visibility) && visibility === 'specified') { + visibility = 'specified'; + } else { + visibility = props.reply.visibility; + } + if (visibility === 'specified') { + if (props.reply.visibleUserIds) { + os.api('users/show', { + userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId), + }).then(users => { + users.forEach(pushVisibleUser); + }); + } if (props.reply.userId !== $i.id) { os.api("users/show", { userId: props.reply.userId }).then(