From 6229e9cb5b4e39e1b788e9ab3374575953c087c6 Mon Sep 17 00:00:00 2001 From: IanM Date: Sun, 1 Dec 2024 21:08:28 +0000 Subject: [PATCH] fix: frontend error when includes dont have recipientUsers --- js/src/forum/extenders/Discussion.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/forum/extenders/Discussion.js b/js/src/forum/extenders/Discussion.js index 1ab73b3..69f323c 100644 --- a/js/src/forum/extenders/Discussion.js +++ b/js/src/forum/extenders/Discussion.js @@ -26,11 +26,11 @@ export default () => { const add = function (discussion, items, long) { let recipients = []; - if (discussion.recipientUsers().length) { + if (discussion.recipientUsers?.().length) { recipients = recipients.concat(discussion.recipientUsers()); } - if (discussion.recipientGroups().length) { + if (discussion.recipientGroups?.().length) { recipients = recipients.concat(discussion.recipientGroups()); } @@ -125,7 +125,7 @@ function controls() { ) ); } - if (discussion && discussion.recipientUsers().find((user) => user?.id() === app.session.user?.id())) { + if (discussion && discussion.recipientUsers?.().find?.((user) => user?.id() === app.session.user?.id())) { items.add( 'remove', Button.component(