File tree Expand file tree Collapse file tree 2 files changed +2
-21
lines changed
app/[variants]/(main)/chat/@session/features/SessionListContent/Inbox
store/chat/slices/message Expand file tree Collapse file tree 2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
66import { INBOX_SESSION_ID } from '@/const/session' ;
77import { SESSION_CHAT_URL } from '@/const/url' ;
88import { useSwitchSession } from '@/hooks/useSwitchSession' ;
9- import { getChatStoreState , useChatStore } from '@/store/chat' ;
10- import { chatSelectors } from '@/store/chat/selectors' ;
119import { useServerConfigStore } from '@/store/serverConfig' ;
1210import { useSessionStore } from '@/store/session' ;
1311
@@ -19,24 +17,13 @@ const Inbox = memo(() => {
1917 const activeId = useSessionStore ( ( s ) => s . activeId ) ;
2018 const switchSession = useSwitchSession ( ) ;
2119
22- const openNewTopicOrSaveTopic = useChatStore ( ( s ) => s . openNewTopicOrSaveTopic ) ;
23-
2420 return (
2521 < Link
2622 aria-label = { t ( 'inbox.title' ) }
2723 href = { SESSION_CHAT_URL ( INBOX_SESSION_ID , mobile ) }
28- onClick = { async ( e ) => {
24+ onClick = { ( e ) => {
2925 e . preventDefault ( ) ;
30- if ( activeId === INBOX_SESSION_ID ) {
31- // If user tap the inbox again, open a new topic
32- const inboxMessages = chatSelectors . inboxActiveTopicMessages ( getChatStoreState ( ) ) ;
33-
34- if ( inboxMessages . length > 0 ) {
35- await openNewTopicOrSaveTopic ( ) ;
36- }
37- } else {
38- switchSession ( INBOX_SESSION_ID ) ;
39- }
26+ switchSession ( INBOX_SESSION_ID ) ;
4027 } }
4128 >
4229 < ListItem
Original file line number Diff line number Diff line change @@ -201,11 +201,6 @@ const isSendButtonDisabledByMessage = (s: ChatStoreState) =>
201201 // 4. when the message is in RAG flow
202202 isInRAGFlow ( s ) ;
203203
204- const inboxActiveTopicMessages = ( state : ChatStoreState ) => {
205- const activeTopicId = state . activeTopicId ;
206- return state . messagesMap [ messageMapKey ( INBOX_SESSION_ID , activeTopicId ) ] || [ ] ;
207- } ;
208-
209204export const chatSelectors = {
210205 activeBaseChats,
211206 activeBaseChatsWithoutTool,
@@ -218,7 +213,6 @@ export const chatSelectors = {
218213 getMessageById,
219214 getMessageByToolCallId,
220215 getTraceIdByMessageId,
221- inboxActiveTopicMessages,
222216 isAIGenerating,
223217 isCreatingMessage,
224218 isCurrentChatLoaded,
You can’t perform that action at this time.
0 commit comments