@@ -60,6 +60,7 @@ import CreateNewDialogFlow from '../../Views/Flow/CreateDialogFlow/CreateNewDial
60
60
import useModal from '../../../hooks/useModal' ;
61
61
import useQBConnection from '../../providers/QuickBloxUIKitProvider/useQBConnection' ;
62
62
import { ProxyConfig } from '../../../CommonTypes/CommonTypes' ;
63
+ import EventMessageType from '../../../Domain/entity/EventMessageType' ;
63
64
64
65
type AIWidgetPlaceHolder = {
65
66
enabled : boolean ;
@@ -243,11 +244,17 @@ const QuickBloxUIKitDesktopLayout: React.FC<
243
244
browserOnline && connectionStatus ,
244
245
) ;
245
246
246
- connectionRepository . subscribe ( ( status ) => {
247
- console . log ( `Connection status: ${ status ? 'CONNECTED' : 'DISCONNECTED' } ` ) ;
248
- if ( status ) setIsOnline ( true ) ;
249
- else setIsOnline ( false ) ;
250
- } ) ;
247
+ connectionRepository . subscribe (
248
+ ( status ) => {
249
+ console . log (
250
+ `Connection status: ${ status ? 'CONNECTED' : 'DISCONNECTED' } ` ,
251
+ ) ;
252
+ if ( status ) setIsOnline ( true ) ;
253
+ else setIsOnline ( false ) ;
254
+ } ,
255
+ EventMessageType . LocalMessage ,
256
+ 'DESKTOP_LAYOUT' ,
257
+ ) ;
251
258
252
259
const [ needRefresh , setNeedRefresh ] = useState ( false ) ;
253
260
const toastConnectionErrorId = React . useRef ( null ) ;
@@ -694,8 +701,18 @@ const QuickBloxUIKitDesktopLayout: React.FC<
694
701
setIsOpen ( ( state ) => ! state ) ;
695
702
} ;
696
703
704
+ const [ isLeaving , setIsLeaving ] = useState ( false ) ;
705
+ const toastLeavingId = React . useRef ( null ) ;
697
706
const handleLeaveDialog = ( ) => {
698
707
if ( dialogToLeave ) {
708
+ setIsLeaving ( true ) ;
709
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
710
+ // @ts -ignore
711
+ toastLeavingId . current = toast ( 'leaving dialog' , {
712
+ autoClose : false ,
713
+ isLoading : true ,
714
+ } ) ;
715
+ // eslint-disable-next-line promise/catch-or-return
699
716
dialogsViewModel
700
717
. deleteDialog ( dialogToLeave as GroupDialogEntity )
701
718
. then ( ( result ) => {
@@ -708,6 +725,12 @@ const QuickBloxUIKitDesktopLayout: React.FC<
708
725
. catch ( ( e ) => {
709
726
console . log ( e ) ;
710
727
toast ( "Can't leave dialog" ) ;
728
+ } )
729
+ . finally ( ( ) => {
730
+ setIsLeaving ( false ) ;
731
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
732
+ // @ts -ignore
733
+ toast . dismiss ( toastLeavingId . current ) ;
711
734
} ) ;
712
735
}
713
736
} ;
@@ -892,12 +915,16 @@ const QuickBloxUIKitDesktopLayout: React.FC<
892
915
if ( ! resultOperation ) {
893
916
toast ( `Incorrect data` ) ;
894
917
}
918
+ } )
919
+ . finally ( ( ) => {
920
+ setFileToSend ( null ) ;
895
921
} ) ;
896
922
}
897
923
} else if ( fileToSend ) {
898
924
toast (
899
925
`file size ${ fileToSend ?. size } must be less then ${ MAXSIZE_FOR_MESSAGE } mb.` ,
900
926
) ;
927
+ setFileToSend ( null ) ;
901
928
}
902
929
} , [ fileToSend ] ) ;
903
930
useEffect ( ( ) => {
@@ -986,6 +1013,18 @@ const QuickBloxUIKitDesktopLayout: React.FC<
986
1013
return (
987
1014
< ToastProvider >
988
1015
< div className = "qb-uikit-layout" >
1016
+ < div
1017
+ style = { {
1018
+ position : 'absolute' ,
1019
+ top : '0' ,
1020
+ left : '0' ,
1021
+ width : '100%' ,
1022
+ height : '100%' ,
1023
+ backgroundColor : 'rgba(0, 0, 0, 0.5)' ,
1024
+ zIndex : '100' ,
1025
+ display : isLeaving ? 'block' : 'none' ,
1026
+ } }
1027
+ />
989
1028
< DesktopLayout
990
1029
mainContainerStyles = { {
991
1030
minHeight : workHeight ,
@@ -1226,7 +1265,11 @@ const QuickBloxUIKitDesktopLayout: React.FC<
1226
1265
minHeight : clientContainerHeight ,
1227
1266
maxHeight : clientContainerHeight ,
1228
1267
} }
1229
- // subHeaderContent={<CompanyLogo />}
1268
+ subHeaderContent = {
1269
+ < div >
1270
+ < p > v0.3.1-beta.5</ p >
1271
+ </ div >
1272
+ }
1230
1273
// upHeaderContent={<CompanyLogo />}
1231
1274
dialog = { selectedDialog }
1232
1275
dialogViewModel = { dialogsViewModel }
0 commit comments