Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[space][web] Fix friends search edge cases

r4khul119f8987b9be
diff --git a/web/apps/space/src/screens/FriendsScreen.tsx b/web/apps/space/src/screens/FriendsScreen.tsx
index 841d8163c0..a9cab30b69 100644
--- a/web/apps/space/src/screens/FriendsScreen.tsx
+++ b/web/apps/space/src/screens/FriendsScreen.tsx
@@ -640,10 +640,10 @@ export const FriendsScreen: React.FC<FriendsScreenProps> = ({
Map<string, Promise<string | null | undefined>>
>(new Map());
const isUnfriendActionRunning = unfriendActionPhase != null;
- const searchTerm = searchQuery.trim().toLocaleLowerCase();
+ const searchTerm = searchQuery.trim().toLowerCase();
const matchesSearch = (friend: FriendProfile) =>
- friend.fullName.toLocaleLowerCase().includes(searchTerm) ||
- `@${friend.username}`.toLocaleLowerCase().includes(searchTerm);
+ friend.fullName.toLowerCase().includes(searchTerm) ||
+ `@${friend.username}`.toLowerCase().includes(searchTerm);
const visibleFriendRequests = searchTerm
? friendRequests.filter((request) => matchesSearch(request.friend))
: friendRequests;
@@ -860,7 +860,9 @@ export const FriendsScreen: React.FC<FriendsScreenProps> = ({
tabIndex={-1}
>
{!isLoading &&
- (friendRequests.length > 0 || friends.length > 0) && (
+ (friendRequests.length > 0 ||
+ friends.length > 0 ||
+ Boolean(searchTerm)) && (
<Box
sx={{
alignItems: "center",