don't show markdown preview till args are there for edit tool
This commit is contained in:
parent
4ef662d264
commit
931e07fc07
1 changed files with 5 additions and 4 deletions
|
|
@ -16,13 +16,12 @@ type EditToolCallProps = {
|
|||
};
|
||||
|
||||
export function EditFile(props: EditToolCallProps) {
|
||||
const src = `\`\`\`${getMarkdownLanguageTagForFile(props.relativeFilePath ?? "test.txt")} ${props.relativeFilePath}\n${props.changes ?? ""}\n\`\`\``;
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
const isStreaming = useAppSelector((state) => state.session.isStreaming);
|
||||
|
||||
const applyState = useAppSelector((state) =>
|
||||
selectApplyStateByToolCallId(state, props.toolCallId),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!applyState) {
|
||||
dispatch(
|
||||
|
|
@ -35,10 +34,12 @@ export function EditFile(props: EditToolCallProps) {
|
|||
}
|
||||
}, [applyState, props.toolCallId]);
|
||||
|
||||
if (!props.relativeFilePath) {
|
||||
if (!props.relativeFilePath || !props.changes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const src = `\`\`\`${getMarkdownLanguageTagForFile(props.relativeFilePath ?? "test.txt")} ${props.relativeFilePath}\n${props.changes}\n\`\`\``;
|
||||
|
||||
return (
|
||||
<StyledMarkdownPreview
|
||||
isRenderingInStepContainer
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue