File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -275,11 +275,13 @@ export function registerIpcEvents() {
275275 Log . info ( 'PhoneIsland is ready to receive events' )
276276 phoneIslandReady = true
277277
278- pendingPhoneIslandEvents . forEach ( ( { event, data} ) => {
279- Log . info ( 'Sending queued event:' , event , data )
280- PhoneIslandController . instance . window . emit ( event , data )
281- } )
282- pendingPhoneIslandEvents = [ ]
278+ setTimeout ( ( ) => {
279+ pendingPhoneIslandEvents . forEach ( ( { event, data} ) => {
280+ Log . info ( 'Sending queued event:' , event , data )
281+ PhoneIslandController . instance . window . emit ( event , data )
282+ } )
283+ pendingPhoneIslandEvents = [ ]
284+ } , 1000 )
283285 } )
284286
285287 ipcMain . on ( IPC_EVENTS . CHANGE_PREFERRED_DEVICES , ( _ , devices ) => {
Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ export const usePhoneIslandEventListener = () => {
236236 } ) ,
237237 ...eventHandler ( PHONE_ISLAND_EVENTS [ "phone-island-webrtc-registered" ] , ( ) => {
238238 setTimeout ( ( ) => {
239+ Log . info ( "phone-island-webrtc-registered" )
239240 window . electron . send ( IPC_EVENTS . PHONE_ISLAND_READY )
240241 } , 2000 ) ;
241242 } ) ,
Original file line number Diff line number Diff line change @@ -72,9 +72,18 @@ export function PhoneIslandPage() {
7272 } )
7373
7474 window . electron . receive ( IPC_EVENTS . CHANGE_PREFERRED_DEVICES , ( devices : PreferredDevices ) => {
75- eventDispatch ( PHONE_ISLAND_EVENTS [ 'phone-island-audio-input-change' ] , { deviceId : devices . audioInput } )
76- eventDispatch ( PHONE_ISLAND_EVENTS [ 'phone-island-video-input-change' ] , { deviceId : devices . videoInput } )
77- eventDispatch ( PHONE_ISLAND_EVENTS [ 'phone-island-audio-output-change' ] , { deviceId : devices . audioOutput } )
75+ setTimeout ( ( ) => {
76+ Log . info ( "CHANGE_PREFERRED_DEVICES" , "audio-output" )
77+ eventDispatch ( PHONE_ISLAND_EVENTS [ 'phone-island-audio-output-change' ] , { deviceId : devices . audioOutput } )
78+ setTimeout ( ( ) => {
79+ Log . info ( "CHANGE_PREFERRED_DEVICES" , "audio-input" )
80+ eventDispatch ( PHONE_ISLAND_EVENTS [ 'phone-island-audio-input-change' ] , { deviceId : devices . audioInput } )
81+ setTimeout ( ( ) => {
82+ Log . info ( "CHANGE_PREFERRED_DEVICES" , "video-input" )
83+ eventDispatch ( PHONE_ISLAND_EVENTS [ 'phone-island-video-input-change' ] , { deviceId : devices . videoInput } )
84+ } , 500 ) ;
85+ } , 500 ) ;
86+ } , 500 ) ;
7887 } )
7988
8089 window . electron . receive ( IPC_EVENTS . TRANSFER_CALL , ( to : string ) => {
You can’t perform that action at this time.
0 commit comments