🐛 fix: fix share single message (#11840)

fix share single message
This commit is contained in:
Arvin Xu
2026-01-26 11:59:10 +08:00
committed by GitHub
parent 70a086782e
commit 9433bbbf00
2 changed files with 11 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ import { useAgentStore } from '@/store/agent';
import { agentSelectors } from '@/store/agent/selectors';
import { useAgentMeta, useIsBuiltinAgent } from '../../../hooks';
import { normalizeThinkTags, processWithArtifact } from '../../../utils/markdown';
import { styles as containerStyles } from '../style';
import { styles } from './style';
import { type FieldType } from './type';
@@ -34,6 +35,9 @@ const Preview = memo<PreviewProps>(
const agentMeta = useAgentMeta(message.agentId);
const isBuiltinAgent = useIsBuiltinAgent();
// Process message content for proper rendering
const processedContent = normalizeThinkTags(processWithArtifact(message.content));
const { t } = useTranslation('chat');
const displayTitle = agentMeta.title || title;
@@ -79,6 +83,7 @@ const Preview = memo<PreviewProps>(
title: displayTitle,
}}
id={message.id}
message={processedContent}
/>
</Flexbox>
{withFooter ? (

View File

@@ -1,5 +1,7 @@
import type { StateCreator } from 'zustand';
import { useChatStore } from '@/store/chat';
import type { State } from '../../initialState';
export interface InputAction {
@@ -22,10 +24,14 @@ export interface InputAction {
export const inputSlice: StateCreator<State & InputAction, [], [], InputAction> = (set) => ({
cleanupInput: () => {
set({ editor: null, inputMessage: '' });
// Also clear ChatStore's mainInputEditor
useChatStore.setState({ mainInputEditor: null });
},
setEditor: (editor) => {
set({ editor });
// Sync to ChatStore's mainInputEditor for error recovery in sendMessage
useChatStore.setState({ mainInputEditor: editor });
},
updateInputMessage: (message) => {