File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
packages/react-native-sdk/src/hooks Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 77 getNotifeeLibNoThrowForKeepCallAlive ,
88 getKeepCallAliveForegroundServiceTypes ,
99} from '../utils/push/libs/notifee' ;
10- import { usePrevious } from '../utils/hooks' ;
1110
1211const notifeeLib = getNotifeeLibNoThrowForKeepCallAlive ( ) ;
1312
@@ -86,23 +85,12 @@ export const useAndroidKeepCallAliveEffect = () => {
8685 const { useCallCallingState } = useCallStateHooks ( ) ;
8786 const callingState = useCallCallingState ( ) ;
8887
89- const prevCallingState = usePrevious ( callingState ) ;
90-
91- const isStartingToJoin =
92- prevCallingState === CallingState . IDLE &&
93- callingState === CallingState . JOINING ;
94- const isStartingToJoinFromRinging =
95- prevCallingState === CallingState . RINGING &&
96- callingState === CallingState . JOINING ;
9788 const isOutgoingCall =
9889 callingState === CallingState . RINGING && call ?. isCreatedByMe ;
9990 const isCallJoined = callingState === CallingState . JOINED ;
10091
10192 const shouldStartForegroundService =
102- isStartingToJoin ||
103- isStartingToJoinFromRinging ||
104- isOutgoingCall ||
105- isCallJoined ;
93+ ! foregroundServiceStartedRef . current && ( isOutgoingCall || isCallJoined ) ;
10694
10795 useEffect ( ( ) : ( ( ) => void ) | undefined => {
10896 if ( Platform . OS === 'ios' || ! activeCallCid ) {
You can’t perform that action at this time.
0 commit comments