Skip to content

Commit

Permalink
fix: frontend error when request includes don't have recipientUsers (
Browse files Browse the repository at this point in the history
…#209)

* chore: yarn upgrade

* fix: frontend error when includes dont have recipientUsers
  • Loading branch information
imorland authored Dec 1, 2024
1 parent 74821ed commit 62513f4
Show file tree
Hide file tree
Showing 2 changed files with 872 additions and 1,044 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
Loading

0 comments on commit 62513f4

Please sign in to comment.