Skip to content

fix: Reports empty state is blank briefly #59711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Lottie/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function Lottie({source, webStyle, shouldLoadAfterInteractions, ...props}: Props
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
source={animationFile}
key={`${hasNavigatedAway}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using a template string? Can we just pass the variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luacmartins hasNavigatedAway has type 'boolean' and it is not assignable to type 'Key | null | undefined'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying. That looks a bit odd though, maybe we could have used a different key, but I won't block on that

ref={(ref) => {
if (typeof forwardedRef === 'function') {
forwardedRef(ref);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS
);
}

if (shouldShowEmptyState(isDataLoaded, data.length, searchResults.search.type) && isFocused) {
if (shouldShowEmptyState(isDataLoaded, data.length, searchResults.search.type)) {
return (
<View style={[shouldUseNarrowLayout ? styles.searchListContentContainerStyles : styles.mt3, styles.flex1]}>
<EmptySearchView
Expand Down