Fix notification screen crashing in rare cases where the status no longer exists (#31403)
This commit is contained in:
parent
6bd7da72e9
commit
0d85a79f19
5 changed files with 15 additions and 9 deletions
|
@ -37,7 +37,11 @@ export const NotificationMention: React.FC<{
|
|||
unread: boolean;
|
||||
}> = ({ notification, unread }) => {
|
||||
const [isDirect, isReply] = useAppSelector((state) => {
|
||||
const status = state.statuses.get(notification.statusId) as Status;
|
||||
const status = state.statuses.get(notification.statusId) as
|
||||
| Status
|
||||
| undefined;
|
||||
|
||||
if (!status) return [false, false] as const;
|
||||
|
||||
return [
|
||||
status.get('visibility') === 'direct',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue