Skip to content

Commit 2b2bafd

Browse files
authored
Merge pull request #25522 from tienifr/fix/23563
fix: 23563 empty screen shows for a brief moment
2 parents 49d42a9 + e3e20a2 commit 2b2bafd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pages/tasks/TaskAssigneeSelectorModal.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function TaskAssigneeSelectorModal(props) {
7676
const [filteredPersonalDetails, setFilteredPersonalDetails] = useState([]);
7777
const [filteredUserToInvite, setFilteredUserToInvite] = useState(null);
7878
const [filteredCurrentUserOption, setFilteredCurrentUserOption] = useState(null);
79+
const [isLoading, setIsLoading] = React.useState(true);
7980

8081
const updateOptions = useCallback(() => {
8182
const {recentReports, personalDetails, userToInvite, currentUserOption} = OptionsListUtils.getNewChatOptions(
@@ -94,7 +95,10 @@ function TaskAssigneeSelectorModal(props) {
9495
setFilteredRecentReports(recentReports);
9596
setFilteredPersonalDetails(personalDetails);
9697
setFilteredCurrentUserOption(currentUserOption);
97-
}, [props, searchValue]);
98+
if (isLoading) {
99+
setIsLoading(false);
100+
}
101+
}, [props, searchValue, isLoading]);
98102

99103
useEffect(() => {
100104
const debouncedSearch = _.debounce(updateOptions, 200);
@@ -195,7 +199,7 @@ function TaskAssigneeSelectorModal(props) {
195199
onChangeText={onChangeText}
196200
headerMessage={headerMessage}
197201
showTitleTooltip
198-
shouldShowOptions={didScreenTransitionEnd}
202+
shouldShowOptions={didScreenTransitionEnd && !isLoading}
199203
textInputLabel={props.translate('optionsSelector.nameEmailOrPhoneNumber')}
200204
safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle}
201205
/>

0 commit comments

Comments
 (0)