Skip to content

Commit

Permalink
Merge pull request Expensify#32638 from DylanDylann/fix/32635-email-o…
Browse files Browse the repository at this point in the history
…f-newly-added-user-appear-in-the-find-member-disappear

Fix/32635: Clear search input once invite user
  • Loading branch information
yuwenmemon authored Dec 7, 2023
2 parents ae85769 + f1385c3 commit de744ef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/pages/workspace/WorkspaceInviteMessagePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import * as Policy from '@userActions/Policy';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import SearchInputManager from './SearchInputManager';
import {policyDefaultProps, policyPropTypes} from './withPolicy';
import withPolicyAndFullscreenLoading from './withPolicyAndFullscreenLoading';

Expand Down Expand Up @@ -126,6 +127,7 @@ class WorkspaceInviteMessagePage extends React.Component {
Keyboard.dismiss();
Policy.addMembersToWorkspace(this.props.invitedEmailsToAccountIDsDraft, this.state.welcomeNote, this.props.route.params.policyID);
Policy.setWorkspaceInviteMembersDraft(this.props.route.params.policyID, {});
SearchInputManager.searchInput = '';
// Pop the invite message page before navigating to the members page.
Navigation.goBack(ROUTES.HOME);
Navigation.navigate(ROUTES.WORKSPACE_MEMBERS.getRoute(this.props.route.params.policyID));
Expand Down
3 changes: 0 additions & 3 deletions src/pages/workspace/WorkspaceInvitePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ function WorkspaceInvitePage(props) {
};

useEffect(() => {
if (!SearchInputManager.searchInput) {
return;
}
setSearchTerm(SearchInputManager.searchInput);
}, []);

Expand Down
3 changes: 0 additions & 3 deletions src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ function WorkspaceMembersPage(props) {
const isFocusedScreen = useIsFocused();

useEffect(() => {
if (!SearchInputManager.searchInput) {
return;
}
setSearchValue(SearchInputManager.searchInput);
}, [isFocusedScreen]);

Expand Down

0 comments on commit de744ef

Please sign in to comment.