mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Rn jitsi sdk component unmount close (#13636)
* sdk(react-native-sdk): rnsdk JitsiMeeting component unmount close
This commit is contained in:
@@ -3,7 +3,14 @@
|
||||
// NB: This import must always come first.
|
||||
import './react/bootstrap.native';
|
||||
|
||||
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||
import React, {
|
||||
forwardRef,
|
||||
useEffect,
|
||||
useImperativeHandle,
|
||||
useLayoutEffect,
|
||||
useRef,
|
||||
useState
|
||||
} from 'react';
|
||||
import { View, ViewStyle } from 'react-native';
|
||||
|
||||
import { appNavigate } from './react/features/app/actions.native';
|
||||
@@ -111,6 +118,22 @@ export const JitsiMeeting = forwardRef((props: IAppProps, ref) => {
|
||||
}, []
|
||||
);
|
||||
|
||||
|
||||
// eslint-disable-next-line arrow-body-style
|
||||
useLayoutEffect(() => {
|
||||
/**
|
||||
* When you close the component you need to reset it.
|
||||
* In some cases it needs to be added as the parent component may have been destroyed.
|
||||
* Without this change the call remains active without having the jitsi screen.
|
||||
*/
|
||||
return () => {
|
||||
const dispatch = app.current?.state?.store?.dispatch;
|
||||
|
||||
dispatch && dispatch(appNavigate(undefined));
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
return (
|
||||
<View style = { style as ViewStyle }>
|
||||
<App
|
||||
|
||||
Reference in New Issue
Block a user