Skip to content

Commit

Permalink
Merge pull request Expensify#25522 from tienifr/fix/23563
Browse files Browse the repository at this point in the history
fix: 23563 empty screen shows for a brief moment
  • Loading branch information
Beamanator authored Aug 21, 2023
2 parents 49d42a9 + e3e20a2 commit 2b2bafd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/tasks/TaskAssigneeSelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function TaskAssigneeSelectorModal(props) {
const [filteredPersonalDetails, setFilteredPersonalDetails] = useState([]);
const [filteredUserToInvite, setFilteredUserToInvite] = useState(null);
const [filteredCurrentUserOption, setFilteredCurrentUserOption] = useState(null);
const [isLoading, setIsLoading] = React.useState(true);

const updateOptions = useCallback(() => {
const {recentReports, personalDetails, userToInvite, currentUserOption} = OptionsListUtils.getNewChatOptions(
Expand All @@ -94,7 +95,10 @@ function TaskAssigneeSelectorModal(props) {
setFilteredRecentReports(recentReports);
setFilteredPersonalDetails(personalDetails);
setFilteredCurrentUserOption(currentUserOption);
}, [props, searchValue]);
if (isLoading) {
setIsLoading(false);
}
}, [props, searchValue, isLoading]);

useEffect(() => {
const debouncedSearch = _.debounce(updateOptions, 200);
Expand Down Expand Up @@ -195,7 +199,7 @@ function TaskAssigneeSelectorModal(props) {
onChangeText={onChangeText}
headerMessage={headerMessage}
showTitleTooltip
shouldShowOptions={didScreenTransitionEnd}
shouldShowOptions={didScreenTransitionEnd && !isLoading}
textInputLabel={props.translate('optionsSelector.nameEmailOrPhoneNumber')}
safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle}
/>
Expand Down

0 comments on commit 2b2bafd

Please sign in to comment.