Fix space invite edge cases

This commit is contained in:
Michael Telatynski 2021-09-29 14:04:02 +01:00
parent c3bac33b9d
commit d6cab320e9
4 changed files with 27 additions and 9 deletions

View file

@ -111,6 +111,7 @@ import { PosthogAnalytics } from '../../PosthogAnalytics';
import { initSentry } from "../../sentry";
import { logger } from "matrix-js-sdk/src/logger";
import { showSpaceInvite } from "../../utils/space";
/** constants for MatrixChat.state.view */
export enum Views {
@ -741,9 +742,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
case 'view_create_chat':
showStartChatInviteDialog(payload.initialText || "");
break;
case 'view_invite':
showRoomInviteDialog(payload.roomId);
case 'view_invite': {
const room = MatrixClientPeg.get().getRoom(payload.roomId);
if (room?.isSpaceRoom()) {
showSpaceInvite(room);
} else {
showRoomInviteDialog(payload.roomId);
}
break;
}
case 'view_last_screen':
// This function does what we want, despite the name. The idea is that it shows
// the last room we were looking at or some reasonable default/guess. We don't