File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
peerprep-fe/src/app/collaboration/components Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,10 @@ const AudioSharing = () => {
109109
110110 peer . on ( 'error' , ( err : Error ) => {
111111 console . error ( 'Peer connection error:' , err ) ;
112- cleanupAudio ( true ) ;
112+ setTimeout ( ( ) => {
113+ cleanupAudio ( true ) ;
114+ createPeer ( stream , initiator ) ; // Recreate the peer
115+ } , 2000 ) ;
113116 } ) ;
114117
115118 peer . on ( 'close' , ( ) => {
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ const CollaborationEditor = ({ matchId }: CollaborationEditorProps) => {
127127 prevClientsRef . current = newClients ;
128128 setConnectedClients ( newClients ) ;
129129 }
130- } , 1000 ) ; // Debounce for 1 second
130+ } , 5000 ) ; // Debounce for 1 second
131131 } ;
132132
133133 const handleEditorMount = ( editor : MonacoEditor . IStandaloneCodeEditor ) => {
@@ -181,7 +181,7 @@ const CollaborationEditor = ({ matchId }: CollaborationEditorProps) => {
181181 if ( providerRef . current ?. wsconnected ) {
182182 updateLocalAwareness ( ) ;
183183 }
184- } , 30000 ) ; // Refresh every 30 seconds
184+ } , 5000 ) ;
185185
186186 return ( ) => {
187187 clearInterval ( refreshInterval ) ;
You can’t perform that action at this time.
0 commit comments