Skip to content

Commit

Permalink
fix: 23563 empty screen shows for a brief moment
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Aug 19, 2023
1 parent 03cf0b1 commit e3e20a2
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 e3e20a2

Please sign in to comment.