Be more sane

This commit is contained in:
Travis Ralston 2020-09-16 15:47:06 -06:00
parent 959b8dd314
commit dca48b984f

View file

@ -34,15 +34,8 @@ export default class MJitsiWidgetEvent extends React.PureComponent<IProps> {
const prevUrl = this.props.mxEvent.getPrevContent()['url'];
const senderName = this.props.mxEvent.sender?.name || this.props.mxEvent.getSender();
// XXX: We are assuming that there will only be one Jitsi widget per room, which isn't entirely
// safe but if there's more than 1 the user will be super confused anyways - the copy doesn't
// need to concern itself with this.
const roomInfo = WidgetStore.instance.getRoom(this.props.mxEvent.getRoomId());
const isPinned = roomInfo?.widgets
.some(w => WidgetType.JITSI.matches(w.type) && WidgetStore.instance.isPinned(w.id));
let joinCopy = _t('Join the conference at the top of this room');
if (!isPinned) {
if (!WidgetStore.instance.isPinned(this.props.mxEvent.getStateKey())) {
joinCopy = _t('Join the conference from the room information card on the right');
}