Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: fix share single message (#11840)

Arvin Xu9433bbbf0052
diff --git a/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx b/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx
index 73ea631a058..68128fa61f2 100644
--- a/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx
+++ b/src/features/Conversation/components/ShareMessageModal/ShareImage/Preview.tsx
@@ -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 ? (
diff --git a/src/features/Conversation/store/slices/input/action.ts b/src/features/Conversation/store/slices/input/action.ts
index 53c496c8008..c34b262d366 100644
--- a/src/features/Conversation/store/slices/input/action.ts
+++ b/src/features/Conversation/store/slices/input/action.ts
@@ -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) => {