From fde8a9fd88642df4bc978c360c154e698083a4c5 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 1 Feb 2024 07:20:26 -0500 Subject: [PATCH] fix: Cannot read properties of undefined (reading 'id') --- app/components/Sharing/DocumentMemberList.tsx | 2 +- app/models/Document.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/Sharing/DocumentMemberList.tsx b/app/components/Sharing/DocumentMemberList.tsx index 466b4a4f4..0b125dc8d 100644 --- a/app/components/Sharing/DocumentMemberList.tsx +++ b/app/components/Sharing/DocumentMemberList.tsx @@ -106,7 +106,7 @@ function DocumentMembersList({ document, invitedInSession }: Props) { document.members, (user) => (invitedInSession.includes(user.id) ? "_" : "") + - user.name.toLowerCase(), + user.name.toLocaleLowerCase(), "asc" ), [document.members, invitedInSession] diff --git a/app/models/Document.ts b/app/models/Document.ts index 3dc6df56d..fa224ee97 100644 --- a/app/models/Document.ts +++ b/app/models/Document.ts @@ -242,7 +242,8 @@ export default class Document extends ParanoidModel { get members(): User[] { return this.store.rootStore.userMemberships.orderedData .filter((m) => m.documentId === this.id) - .map((m) => m.user); + .map((m) => m.user) + .filter(Boolean); } @computed