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';
6
6
import { INBOX_SESSION_ID } from '@/const/session' ;
7
7
import { SESSION_CHAT_URL } from '@/const/url' ;
8
8
import { useSwitchSession } from '@/hooks/useSwitchSession' ;
9
- import { getChatStoreState , useChatStore } from '@/store/chat' ;
10
- import { chatSelectors } from '@/store/chat/selectors' ;
11
9
import { useServerConfigStore } from '@/store/serverConfig' ;
12
10
import { useSessionStore } from '@/store/session' ;
13
11
@@ -19,24 +17,13 @@ const Inbox = memo(() => {
19
17
const activeId = useSessionStore ( ( s ) => s . activeId ) ;
20
18
const switchSession = useSwitchSession ( ) ;
21
19
22
- const openNewTopicOrSaveTopic = useChatStore ( ( s ) => s . openNewTopicOrSaveTopic ) ;
23
-
24
20
return (
25
21
< Link
26
22
aria-label = { t ( 'inbox.title' ) }
27
23
href = { SESSION_CHAT_URL ( INBOX_SESSION_ID , mobile ) }
28
- onClick = { async ( e ) => {
24
+ onClick = { ( e ) => {
29
25
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 ) ;
40
27
} }
41
28
>
42
29
< ListItem
Original file line number Diff line number Diff line change @@ -201,11 +201,6 @@ const isSendButtonDisabledByMessage = (s: ChatStoreState) =>
201
201
// 4. when the message is in RAG flow
202
202
isInRAGFlow ( s ) ;
203
203
204
- const inboxActiveTopicMessages = ( state : ChatStoreState ) => {
205
- const activeTopicId = state . activeTopicId ;
206
- return state . messagesMap [ messageMapKey ( INBOX_SESSION_ID , activeTopicId ) ] || [ ] ;
207
- } ;
208
-
209
204
export const chatSelectors = {
210
205
activeBaseChats,
211
206
activeBaseChatsWithoutTool,
@@ -218,7 +213,6 @@ export const chatSelectors = {
218
213
getMessageById,
219
214
getMessageByToolCallId,
220
215
getTraceIdByMessageId,
221
- inboxActiveTopicMessages,
222
216
isAIGenerating,
223
217
isCreatingMessage,
224
218
isCurrentChatLoaded,
You can’t perform that action at this time.
0 commit comments