Skip to content

Commit

Permalink
fix: frontend error when includes dont have recipientUsers
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Dec 1, 2024
1 parent 2c7c2d0 commit 6229e9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/src/forum/extenders/Discussion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 6229e9c

Please sign in to comment.