Skip to content

Commit

Permalink
clear selected members data when navigating from ReportParticipantsPage.
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
  • Loading branch information
Krishna2323 committed Apr 13, 2024
1 parent 02f784c commit 5065abd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useCallback, useMemo, useRef, useState} from 'react';
import {useIsFocused} from '@react-navigation/native';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {InteractionManager, View} from 'react-native';
import type {TextInput} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
Expand Down Expand Up @@ -58,6 +59,14 @@ function ReportParticipantsPage({report, personalDetails, session}: ReportPartic
const currentUserAccountID = Number(session?.accountID);
const isCurrentUserAdmin = ReportUtils.isGroupChatAdmin(report, currentUserAccountID);
const isGroupChat = useMemo(() => ReportUtils.isGroupChat(report), [report]);
const isFocused = useIsFocused();

useEffect(() => {
if (isFocused) {
return;
}
setSelectedMembers([]);
}, [isFocused]);

const getUsers = useCallback((): MemberOption[] => {
let result: MemberOption[] = [];
Expand Down

0 comments on commit 5065abd

Please sign in to comment.