From e3e20a264b9edd545517c1f28c9fec573feab2a9 Mon Sep 17 00:00:00 2001 From: tienifr Date: Sat, 19 Aug 2023 17:14:41 +0700 Subject: [PATCH] fix: 23563 empty screen shows for a brief moment --- src/pages/tasks/TaskAssigneeSelectorModal.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/tasks/TaskAssigneeSelectorModal.js b/src/pages/tasks/TaskAssigneeSelectorModal.js index 4803fc5b200..37f9d881532 100644 --- a/src/pages/tasks/TaskAssigneeSelectorModal.js +++ b/src/pages/tasks/TaskAssigneeSelectorModal.js @@ -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( @@ -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); @@ -195,7 +199,7 @@ function TaskAssigneeSelectorModal(props) { onChangeText={onChangeText} headerMessage={headerMessage} showTitleTooltip - shouldShowOptions={didScreenTransitionEnd} + shouldShowOptions={didScreenTransitionEnd && !isLoading} textInputLabel={props.translate('optionsSelector.nameEmailOrPhoneNumber')} safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle} />