Skip to content

Commit 55462b9

Browse files
authored
🐛 fix: Revert "💄 style: Open new topic by tap Just Chat again" (#8402)
This reverts commit 7e2f4ce.
1 parent 9a95886 commit 55462b9

File tree

2 files changed

+2
-21
lines changed
  • src
    • app/[variants]/(main)/chat/@session/features/SessionListContent/Inbox
    • store/chat/slices/message

2 files changed

+2
-21
lines changed

src/app/[variants]/(main)/chat/@session/features/SessionListContent/Inbox/index.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
66
import { INBOX_SESSION_ID } from '@/const/session';
77
import { SESSION_CHAT_URL } from '@/const/url';
88
import { useSwitchSession } from '@/hooks/useSwitchSession';
9-
import { getChatStoreState, useChatStore } from '@/store/chat';
10-
import { chatSelectors } from '@/store/chat/selectors';
119
import { useServerConfigStore } from '@/store/serverConfig';
1210
import { 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

src/store/chat/slices/message/selectors.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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-
209204
export 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,

0 commit comments

Comments
 (0)