|
@@ -614,7 +614,12 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
|
|
|
useEffect(() => {
|
|
|
const handleAppStateChange = async (nextAppState: AppStateStatus) => {
|
|
|
- if (appState.current.match(/inactive|background/) && nextAppState === 'active') {
|
|
|
+ const prevState = appState.current;
|
|
|
+ appState.current = nextAppState;
|
|
|
+
|
|
|
+ if (prevState.match(/inactive|background/) && nextAppState === 'active') {
|
|
|
+ refetch();
|
|
|
+
|
|
|
if (!socket.current || socket.current.readyState === WebSocket.CLOSED) {
|
|
|
socket.current = new WebSocket(WEBSOCKET_URL);
|
|
|
socket.current.onopen = () => {
|