diff --git a/packages/api/routes/conversations.ts b/packages/api/routes/conversations.ts index 717d79f..fe2723f 100644 --- a/packages/api/routes/conversations.ts +++ b/packages/api/routes/conversations.ts @@ -74,7 +74,9 @@ const getOneOnOneConversationIfExists = async (req: Request, res: Response, next new NirvanaResponse( resultConversation?._id ?? undefined, undefined, - 'here is the conversation if it exists', + resultConversation + ? 'no such conversation exists!' + : 'there is a conversation...quick dial them now!', ), ); } catch (error) { @@ -93,6 +95,18 @@ const createConversation = async (req: Request, res: Response, next: NextFunctio return next(new Error('must provide who you want to talk to')); } + // if it's a one on one, and one already exists then don't allow creating another convo!! + if (createRequest.otherUsers.length === 1) { + const oneOnOneExists = await ConversationService.getConversationBetweenTwoPeople( + new ObjectId(userInfo.userId), + new ObjectId(createRequest.otherUsers[0]._id), + ); + + if (oneOnOneExists) { + return next(Error('Already have a conversatoin with them! quick dial them!')); + } + } + // process of creating other conversation user members with their user objects // for cached data purposes const conversationUserMembers: ConversationUserMember[] = []; diff --git a/packages/desktop/src/tree/Login.tsx b/packages/desktop/src/tree/Login.tsx index 98e97f1..ea1a587 100644 --- a/packages/desktop/src/tree/Login.tsx +++ b/packages/desktop/src/tree/Login.tsx @@ -61,6 +61,7 @@ export default function Login() { alignItems: 'center', gap: 5, background: blueGrey[50], + WebkitAppRegion: 'drag', }} >