From 30d4334016f1414f483e89267d3d0e183eca3ea1 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Fri, 10 Jan 2025 01:47:22 +0100 Subject: [PATCH 1/2] BA-2070 Fix chatroom search --- .../modules/messages/ChatRoomsList/index.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/components/modules/messages/ChatRoomsList/index.tsx b/packages/components/modules/messages/ChatRoomsList/index.tsx index 197ae5aa..b536d126 100644 --- a/packages/components/modules/messages/ChatRoomsList/index.tsx +++ b/packages/components/modules/messages/ChatRoomsList/index.tsx @@ -40,18 +40,27 @@ const ChatRoomsList: FC = ({ const isInUnreadTab = tab === CHAT_TAB_VALUES.unread const isInArchivedTab = tab === CHAT_TAB_VALUES.archived + const searchValue = watch('search') const handleSearchChange: ChangeEventHandler = (e) => { const value = e.target.value || '' startTransition(() => { - refetch({ q: value }) + refetch({ + q: value, + unreadMessages: isInUnreadTab, + archived: isInArchivedTab, + }) }) } const handleSearchClear = () => { startTransition(() => { reset() - refetch({ q: '' }) + refetch({ + q: '', + unreadMessages: isInUnreadTab, + archived: isInArchivedTab, + }) }) } @@ -60,6 +69,7 @@ const ChatRoomsList: FC = ({ startRefetchTransition(() => { refetch( { + q: searchValue, unreadMessages: newTab === CHAT_TAB_VALUES.unread, archived: newTab === CHAT_TAB_VALUES.archived, }, @@ -119,7 +129,6 @@ const ChatRoomsList: FC = ({ const renderListContent = () => { const emptyChatRoomsList = chatRooms.length === 0 - const searchValue = watch('search') if (!isPending && searchValue && emptyChatRoomsList) return @@ -156,6 +165,11 @@ const ChatRoomsList: FC = ({ }} > Date: Wed, 15 Jan 2025 10:35:00 +0100 Subject: [PATCH 2/2] BA-2070 Versioning --- packages/components/CHANGELOG.md | 6 ++++++ packages/components/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 68e21cec..a69f3652 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,5 +1,11 @@ # @baseapp-frontend/components +## 0.0.48 + +### Patch Changes + +- Chatroom search fixed + ## 0.0.47 ### Patch Changes diff --git a/packages/components/package.json b/packages/components/package.json index de454ede..fc189a56 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,7 +1,7 @@ { "name": "@baseapp-frontend/components", "description": "BaseApp components modules such as comments, notifications, messages, and more.", - "version": "0.0.47", + "version": "0.0.48", "main": "./index.ts", "types": "dist/index.d.ts", "sideEffects": false,