mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-12 18:20:28 +03:00
Keep direct rooms orthogonal (#183)
Signed-off-by: ajbura <ajbura@gmail.com>
This commit is contained in:
parent
a9692f7db4
commit
c8ae428df8
3 changed files with 31 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ import initMatrix from '../../../client/initMatrix';
|
|||
import cons from '../../../client/state/cons';
|
||||
import * as roomActions from '../../../client/action/room';
|
||||
import { selectRoom } from '../../../client/action/navigation';
|
||||
import { hasDMWith } from '../../../util/matrixUtil';
|
||||
|
||||
import Text from '../../atoms/text/Text';
|
||||
import Button from '../../atoms/button/Button';
|
||||
|
|
@ -104,6 +105,13 @@ function InviteUser({
|
|||
|
||||
async function createDM(userId) {
|
||||
if (mx.getUserId() === userId) return;
|
||||
const dmRoomId = hasDMWith(userId);
|
||||
if (dmRoomId) {
|
||||
selectRoom(dmRoomId);
|
||||
onRequestClose();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
addUserToProc(userId);
|
||||
procUserError.delete(userId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue