fixing bug with selecting for one on one and closing dialog

This commit is contained in:
talksik
2022-06-11 13:24:49 -05:00
parent 6e8fde89a9
commit f2f930fbf1
2 changed files with 4 additions and 3 deletions
@@ -115,7 +115,7 @@ export function ConversationProvider({ children }: { children: React.ReactNode }
if (!otherUsers || otherUsers.length === 0) {
toast.error('Must provider users');
return;
return false;
}
// todo: check to make sure that the other user is not the user himself, although backend should error out
@@ -128,7 +128,7 @@ export function ConversationProvider({ children }: { children: React.ReactNode }
toast.success('already have this user...quick dialing');
selectConversation(conversationDmCheck.data, true);
return;
return true;
}
}
@@ -99,9 +99,10 @@ export default function NewConversationDialog() {
// clear form for next time
if (succeeded) {
toast('succeeded');
setSelectedUsers([]);
setConversationName('');
handleSetPage('SELECTED_CONVERSATION');
handleSetPage('SELECTED_CONVERSATION')();
}
setIsSubmitting(false);