forked from mystiq/hydrogen-web
don't trip over missing create events when loading power levels
as the test from previous commit fails because of that, and powerlevels works fine without
This commit is contained in:
parent
4a8a6168cd
commit
84ecaa2ee1
1 changed files with 8 additions and 4 deletions
|
@ -84,10 +84,14 @@ export class Timeline {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const createState = await txn.roomState.get(this._roomId, "m.room.create", "");
|
const createState = await txn.roomState.get(this._roomId, "m.room.create", "");
|
||||||
return new PowerLevels({
|
if (createState) {
|
||||||
createEvent: createState.event,
|
return new PowerLevels({
|
||||||
ownUserId: this._ownMember.userId
|
createEvent: createState.event,
|
||||||
});
|
ownUserId: this._ownMember.userId
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return new PowerLevels({ownUserId: this._ownMember.userId});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_setupEntries(timelineEntries) {
|
_setupEntries(timelineEntries) {
|
||||||
|
|
Loading…
Reference in a new issue