@@ -352,8 +352,10 @@ class DMRoomTile extends React.PureComponent<IDMRoomTileProps> {
352352}
353353
354354interface IInviteDialogProps {
355- // Takes an array of user IDs/emails to invite.
356- onFinished : ( toInvite ?: string [ ] ) => void ;
355+ // Takes a boolean which is true if a user / users were invited /
356+ // a call transfer was initiated or false if the dialog was cancelled
357+ // with no action taken.
358+ onFinished : ( success : boolean ) => void ;
357359
358360 // The kind of invite being performed. Assumed to be KIND_DM if
359361 // not provided.
@@ -685,7 +687,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
685687 should_peek : false ,
686688 joining : false ,
687689 } ) ;
688- this . props . onFinished ( ) ;
690+ this . props . onFinished ( true ) ;
689691 return ;
690692 }
691693
@@ -732,7 +734,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
732734 }
733735
734736 await createRoom ( createRoomOptions ) ;
735- this . props . onFinished ( ) ;
737+ this . props . onFinished ( true ) ;
736738 } catch ( err ) {
737739 logger . error ( err ) ;
738740 this . setState ( {
@@ -764,7 +766,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
764766 const result = await inviteMultipleToRoom ( this . props . roomId , targetIds , true ) ;
765767 CountlyAnalytics . instance . trackSendInvite ( startTime , this . props . roomId , targetIds . length ) ;
766768 if ( ! this . shouldAbortAfterInviteError ( result , room ) ) { // handles setting error message too
767- this . props . onFinished ( ) ;
769+ this . props . onFinished ( true ) ;
768770 }
769771 } catch ( err ) {
770772 logger . error ( err ) ;
@@ -801,7 +803,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
801803 this . state . consultFirst ,
802804 ) ;
803805 }
804- this . props . onFinished ( ) ;
806+ this . props . onFinished ( true ) ;
805807 } ;
806808
807809 private onKeyDown = ( e ) => {
@@ -824,7 +826,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
824826 } ;
825827
826828 private onCancel = ( ) => {
827- this . props . onFinished ( [ ] ) ;
829+ this . props . onFinished ( false ) ;
828830 } ;
829831
830832 private updateSuggestions = async ( term ) => {
@@ -1086,11 +1088,11 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
10861088 private onManageSettingsClick = ( e ) => {
10871089 e . preventDefault ( ) ;
10881090 dis . fire ( Action . ViewUserSettings ) ;
1089- this . props . onFinished ( ) ;
1091+ this . props . onFinished ( false ) ;
10901092 } ;
10911093
10921094 private onCommunityInviteClick = ( e ) => {
1093- this . props . onFinished ( ) ;
1095+ this . props . onFinished ( false ) ;
10941096 showCommunityInviteDialog ( CommunityPrototypeStore . instance . getSelectedCommunityId ( ) ) ;
10951097 } ;
10961098
0 commit comments