mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 23:30:28 +03:00
Prevents undefined object from being checked for values and filtered against
This commit is contained in:
parent
d6ffac74a7
commit
b5ca54d6fd
1 changed files with 3 additions and 0 deletions
|
|
@ -237,6 +237,9 @@ export function RoomViewHeader() {
|
||||||
// I assume there is a global state so I don't have to run this check every time but for now we'll stub this in
|
// I assume there is a global state so I don't have to run this check every time but for now we'll stub this in
|
||||||
const isDirectMessage = () => {
|
const isDirectMessage = () => {
|
||||||
const mDirectsEvent = mx.getAccountData('m.direct');
|
const mDirectsEvent = mx.getAccountData('m.direct');
|
||||||
|
if (mDirectsEvent?.event?.content === undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const { roomId } = room;
|
const { roomId } = room;
|
||||||
return (
|
return (
|
||||||
Object.values(mDirectsEvent?.event?.content).filter((e) => {
|
Object.values(mDirectsEvent?.event?.content).filter((e) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue