1
1
import { useState } from 'react' ;
2
2
import useKey from 'react-use/lib/useKey' ;
3
+ import { clone } from 'lodash' ;
3
4
4
5
import { PubkeyType } from 'libsession_util_nodejs' ;
5
6
import { useDispatch } from 'react-redux' ;
@@ -26,6 +27,7 @@ import { NoResultsForSearch } from '../search/NoResults';
26
27
import { SessionWrapperModal2 } from '../SessionWrapperModal2' ;
27
28
import { useHotkey } from '../../hooks/useHotkey' ;
28
29
import { searchActions } from '../../state/ducks/search' ;
30
+ import { ToastUtils } from '../../session/utils' ;
29
31
30
32
type Props = {
31
33
conversationId : string ;
@@ -45,6 +47,10 @@ async function submitForOpenGroup(convoId: string, pubkeys: Array<string>) {
45
47
url : roomDetails ?. fullUrlWithPubkey ,
46
48
name : convo . getNicknameOrRealUsernameOrPlaceholder ( ) ,
47
49
} ;
50
+ ToastUtils . pushToastInfo (
51
+ 'sendingInvites' ,
52
+ localize ( 'groupInviteSending' ) . withArgs ( { count : pubkeys . length } ) . toString ( )
53
+ ) ;
48
54
// eslint-disable-next-line @typescript-eslint/no-misused-promises
49
55
pubkeys . forEach ( async pubkeyStr => {
50
56
const privateConvo = await ConvoHub . use ( ) . getOrCreateAndWait (
@@ -133,7 +139,8 @@ const InviteContactsDialogInner = (props: Props) => {
133
139
return ;
134
140
}
135
141
if ( isPublic ) {
136
- void submitForOpenGroup ( conversationId , selectedContacts ) ;
142
+ void submitForOpenGroup ( conversationId , clone ( selectedContacts ) ) ;
143
+ empty ( ) ;
137
144
return ;
138
145
}
139
146
if ( ! PubKey . is03Pubkey ( conversationId ) ) {
0 commit comments