Fix Bridges tab crashing when the room does not have bridges
This commit is contained in:
parent
c68a980c59
commit
e32cb175cb
1 changed files with 4 additions and 3 deletions
|
@ -46,9 +46,10 @@ export default class BridgeSettingsTab extends React.Component<IProps> {
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const roomState = client.getRoom(roomId).currentState;
|
const roomState = client.getRoom(roomId).currentState;
|
||||||
|
|
||||||
return [].concat(...BRIDGE_EVENT_TYPES.map((typeName) =>
|
return BRIDGE_EVENT_TYPES.map(typeName => {
|
||||||
Array.from(roomState.events.get(typeName).values()),
|
const events = roomState.events.get(typeName);
|
||||||
));
|
return events ? Array.from(events.values()) : [];
|
||||||
|
}).flat(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in a new issue