Skip to content
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

Nt/user serach update #2909

Merged
merged 3 commits into from
Aug 19, 2024
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
6 changes: 3 additions & 3 deletions src/screens/searchResult/screen/searchResultScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SearchResultScreen = ({ navigation }) => {

// custom debounce to debounce search value but updates search input value instantly
// fixes character missing bug due to lodash debounce
const debouncedSearch = debounce(_handleSearchValue, _handleChangeText, 1000);
const debouncedSearch = debounce(_handleSearchValue, _handleChangeText, 500);

const _navigationGoBack = () => {
navigation.goBack();
Expand All @@ -59,8 +59,8 @@ const SearchResultsTabView = memo(({ searchValue }: { searchValue: string }) =>

const clippedSearchValue =
searchValue.startsWith('#') || searchValue.startsWith('@')
? searchValue.substring(1)
: searchValue;
? searchValue.substring(1).trim().toLowerCase()
: searchValue.trim().toLowerCase();
const isUsername = !!(searchValue.startsWith('#') || searchValue.startsWith('@'));

const _renderTabbar = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const PeopleResultsContainer = ({ children, searchValue, username, isUsername })
setNoResult(true);
setUsers([]);
});
}, [searchValue]);
}, [searchValue, isUsername]);

const _fetchUsernames = async (username) => {
const users = await lookupAccounts(username);
Expand Down