Fix crash against Pleroma (make latest_read_message_by_account
an optional param)
This commit is contained in:
parent
5bb30b6282
commit
6697e0191b
2 changed files with 3 additions and 3 deletions
|
@ -78,8 +78,8 @@ const ChatMessageList: React.FC<IChatMessageList> = ({ chat }) => {
|
||||||
const account = useOwnAccount();
|
const account = useOwnAccount();
|
||||||
const features = useFeatures();
|
const features = useFeatures();
|
||||||
|
|
||||||
const lastReadMessageDateString = chat.latest_read_message_by_account.find((latest) => latest.id === chat.account.id)?.date;
|
const lastReadMessageDateString = chat.latest_read_message_by_account?.find((latest) => latest.id === chat.account.id)?.date;
|
||||||
const myLastReadMessageDateString = chat.latest_read_message_by_account.find((latest) => latest.id === account?.id)?.date;
|
const myLastReadMessageDateString = chat.latest_read_message_by_account?.find((latest) => latest.id === account?.id)?.date;
|
||||||
const lastReadMessageTimestamp = lastReadMessageDateString ? new Date(lastReadMessageDateString) : null;
|
const lastReadMessageTimestamp = lastReadMessageDateString ? new Date(lastReadMessageDateString) : null;
|
||||||
const myLastReadMessageTimestamp = myLastReadMessageDateString ? new Date(myLastReadMessageDateString) : null;
|
const myLastReadMessageTimestamp = myLastReadMessageDateString ? new Date(myLastReadMessageDateString) : null;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ export interface IChat {
|
||||||
id: string
|
id: string
|
||||||
unread: boolean
|
unread: boolean
|
||||||
}
|
}
|
||||||
latest_read_message_by_account: {
|
latest_read_message_by_account?: {
|
||||||
id: string,
|
id: string,
|
||||||
date: string
|
date: string
|
||||||
}[]
|
}[]
|
||||||
|
|
Loading…
Reference in a new issue