🐛 fix: Revert "💄 style: Open new topic by tap Just Chat again" (#8402)

This reverts commit 7e2f4ce5dd.
This commit is contained in:
Arvin Xu
2025-07-12 23:04:10 +08:00
committed by GitHub
parent 9a95886fe7
commit 55462b95ff
2 changed files with 2 additions and 21 deletions
@@ -6,8 +6,6 @@ import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
import { INBOX_SESSION_ID } from '@/const/session';
import { SESSION_CHAT_URL } from '@/const/url';
import { useSwitchSession } from '@/hooks/useSwitchSession';
import { getChatStoreState, useChatStore } from '@/store/chat';
import { chatSelectors } from '@/store/chat/selectors';
import { useServerConfigStore } from '@/store/serverConfig';
import { useSessionStore } from '@/store/session';
@@ -19,24 +17,13 @@ const Inbox = memo(() => {
const activeId = useSessionStore((s) => s.activeId);
const switchSession = useSwitchSession();
const openNewTopicOrSaveTopic = useChatStore((s) => s.openNewTopicOrSaveTopic);
return (
<Link
aria-label={t('inbox.title')}
href={SESSION_CHAT_URL(INBOX_SESSION_ID, mobile)}
onClick={async (e) => {
onClick={(e) => {
e.preventDefault();
if (activeId === INBOX_SESSION_ID) {
// If user tap the inbox again, open a new topic
const inboxMessages = chatSelectors.inboxActiveTopicMessages(getChatStoreState());
if (inboxMessages.length > 0) {
await openNewTopicOrSaveTopic();
}
} else {
switchSession(INBOX_SESSION_ID);
}
switchSession(INBOX_SESSION_ID);
}}
>
<ListItem
@@ -201,11 +201,6 @@ const isSendButtonDisabledByMessage = (s: ChatStoreState) =>
// 4. when the message is in RAG flow
isInRAGFlow(s);
const inboxActiveTopicMessages = (state: ChatStoreState) => {
const activeTopicId = state.activeTopicId;
return state.messagesMap[messageMapKey(INBOX_SESSION_ID, activeTopicId)] || [];
};
export const chatSelectors = {
activeBaseChats,
activeBaseChatsWithoutTool,
@@ -218,7 +213,6 @@ export const chatSelectors = {
getMessageById,
getMessageByToolCallId,
getTraceIdByMessageId,
inboxActiveTopicMessages,
isAIGenerating,
isCreatingMessage,
isCurrentChatLoaded,