chat-fe: redirect to DMs on trivial new group case

Create or view a DM upon trying to create an invite-only group with one invitee.
This commit is contained in:
Liam Fitzgerald 2020-04-14 11:01:31 +10:00
parent 2c870cdfc0
commit a2998bdc41
2 changed files with 5 additions and 0 deletions

View File

@ -261,6 +261,7 @@ export class ShipSearchInput extends Component {
componentDidMount() {
document.addEventListener("mousedown", this.onClick);
document.addEventListener("touchstart", this.onClick);
this.inputRef.current.focus();
}
componentWillUnmount() {

View File

@ -124,6 +124,10 @@ export class NewScreen extends Component {
}
});
if(state.ships.length === 1 && state.security === 'village') {
props.history.push(`/~chat/new/dm/${aud[0]}`);
}
if (!isValid) {
this.setState({
inviteError: true,