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 = () => {
109
109
110
110
peer . on ( 'error' , ( err : Error ) => {
111
111
console . error ( 'Peer connection error:' , err ) ;
112
- cleanupAudio ( true ) ;
112
+ setTimeout ( ( ) => {
113
+ cleanupAudio ( true ) ;
114
+ createPeer ( stream , initiator ) ; // Recreate the peer
115
+ } , 2000 ) ;
113
116
} ) ;
114
117
115
118
peer . on ( 'close' , ( ) => {
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ const CollaborationEditor = ({ matchId }: CollaborationEditorProps) => {
127
127
prevClientsRef . current = newClients ;
128
128
setConnectedClients ( newClients ) ;
129
129
}
130
- } , 1000 ) ; // Debounce for 1 second
130
+ } , 5000 ) ; // Debounce for 1 second
131
131
} ;
132
132
133
133
const handleEditorMount = ( editor : MonacoEditor . IStandaloneCodeEditor ) => {
@@ -181,7 +181,7 @@ const CollaborationEditor = ({ matchId }: CollaborationEditorProps) => {
181
181
if ( providerRef . current ?. wsconnected ) {
182
182
updateLocalAwareness ( ) ;
183
183
}
184
- } , 30000 ) ; // Refresh every 30 seconds
184
+ } , 5000 ) ;
185
185
186
186
return ( ) => {
187
187
clearInterval ( refreshInterval ) ;
You can’t perform that action at this time.
0 commit comments