Skip to content

Commit

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

Fix/32635: Clear search input once invite user

(cherry picked from commit de744ef)
  • Loading branch information
yuwenmemon authored and OSBotify committed Dec 7, 2023
1 parent e20ae4b commit a9fcc75
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 a9fcc75

Please sign in to comment.