mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
Event may not have some properties
So use optional chaining here
This commit is contained in:
parent
85ede8a753
commit
2d06cfefbb
@ -145,13 +145,14 @@ export class RoomChannel extends Disposables implements IChannel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async handleRoomMessage(entry: EventEntry) {
|
private async handleRoomMessage(entry: EventEntry) {
|
||||||
const type = entry.content.msgtype ?? entry.eventType;
|
const type = entry.content?.msgtype ?? entry.eventType;
|
||||||
if (!type.startsWith("m.key.verification") || entry.sender === this.ourUserId) {
|
if (!type?.startsWith("m.key.verification") ||
|
||||||
|
entry.sender === this.ourUserId ||
|
||||||
|
entry.isLoadedFromStorage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("entry", entry);
|
console.log("entry", entry);
|
||||||
await this.log.wrap("RoomChannel.handleRoomMessage", async (log) => {
|
await this.log.wrap("RoomChannel.handleRoomMessage", async (log) => {
|
||||||
console.log("entry", entry);
|
|
||||||
log.log({ l: "entry", entry });
|
log.log({ l: "entry", entry });
|
||||||
if (!this.id) {
|
if (!this.id) {
|
||||||
throw new Error("Couldn't find event-id of request message!");
|
throw new Error("Couldn't find event-id of request message!");
|
||||||
|
Loading…
Reference in New Issue
Block a user