@@ -60,6 +60,7 @@ import CreateNewDialogFlow from '../../Views/Flow/CreateDialogFlow/CreateNewDial
6060import useModal from '../../../hooks/useModal' ;
6161import useQBConnection from '../../providers/QuickBloxUIKitProvider/useQBConnection' ;
6262import { ProxyConfig } from '../../../CommonTypes/CommonTypes' ;
63+ import EventMessageType from '../../../Domain/entity/EventMessageType' ;
6364
6465type AIWidgetPlaceHolder = {
6566 enabled : boolean ;
@@ -243,11 +244,17 @@ const QuickBloxUIKitDesktopLayout: React.FC<
243244 browserOnline && connectionStatus ,
244245 ) ;
245246
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+ ) ;
251258
252259 const [ needRefresh , setNeedRefresh ] = useState ( false ) ;
253260 const toastConnectionErrorId = React . useRef ( null ) ;
@@ -694,8 +701,18 @@ const QuickBloxUIKitDesktopLayout: React.FC<
694701 setIsOpen ( ( state ) => ! state ) ;
695702 } ;
696703
704+ const [ isLeaving , setIsLeaving ] = useState ( false ) ;
705+ const toastLeavingId = React . useRef ( null ) ;
697706 const handleLeaveDialog = ( ) => {
698707 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
699716 dialogsViewModel
700717 . deleteDialog ( dialogToLeave as GroupDialogEntity )
701718 . then ( ( result ) => {
@@ -708,6 +725,12 @@ const QuickBloxUIKitDesktopLayout: React.FC<
708725 . catch ( ( e ) => {
709726 console . log ( e ) ;
710727 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 ) ;
711734 } ) ;
712735 }
713736 } ;
@@ -892,12 +915,16 @@ const QuickBloxUIKitDesktopLayout: React.FC<
892915 if ( ! resultOperation ) {
893916 toast ( `Incorrect data` ) ;
894917 }
918+ } )
919+ . finally ( ( ) => {
920+ setFileToSend ( null ) ;
895921 } ) ;
896922 }
897923 } else if ( fileToSend ) {
898924 toast (
899925 `file size ${ fileToSend ?. size } must be less then ${ MAXSIZE_FOR_MESSAGE } mb.` ,
900926 ) ;
927+ setFileToSend ( null ) ;
901928 }
902929 } , [ fileToSend ] ) ;
903930 useEffect ( ( ) => {
@@ -986,6 +1013,18 @@ const QuickBloxUIKitDesktopLayout: React.FC<
9861013 return (
9871014 < ToastProvider >
9881015 < 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+ />
9891028 < DesktopLayout
9901029 mainContainerStyles = { {
9911030 minHeight : workHeight ,
@@ -1226,7 +1265,11 @@ const QuickBloxUIKitDesktopLayout: React.FC<
12261265 minHeight : clientContainerHeight ,
12271266 maxHeight : clientContainerHeight ,
12281267 } }
1229- // subHeaderContent={<CompanyLogo />}
1268+ subHeaderContent = {
1269+ < div >
1270+ < p > v0.3.1-beta.5</ p >
1271+ </ div >
1272+ }
12301273 // upHeaderContent={<CompanyLogo />}
12311274 dialog = { selectedDialog }
12321275 dialogViewModel = { dialogsViewModel }
0 commit comments