fix: ai response not coming when using 'AI' button (#1091)
* fix: ai response not comming for page * fix: ai response not coming when using 'AI' button
This commit is contained in:
parent
ab273f6be3
commit
d9642eee82
1 changed files with 7 additions and 2 deletions
|
|
@ -365,10 +365,15 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
||||||
content={watch("description_html")}
|
content={watch("description_html")}
|
||||||
htmlContent={watch("description_html")}
|
htmlContent={watch("description_html")}
|
||||||
onResponse={(response) => {
|
onResponse={(response) => {
|
||||||
if (data && handleAiAssistance) handleAiAssistance(response);
|
if (data && handleAiAssistance) {
|
||||||
else {
|
handleAiAssistance(response);
|
||||||
|
editorRef.current?.setEditorValue(
|
||||||
|
`${watch("description_html")}<p>${response}</p>` ?? ""
|
||||||
|
);
|
||||||
|
} else {
|
||||||
setValue("description", {});
|
setValue("description", {});
|
||||||
setValue("description_html", `${watch("description_html")}<p>${response}</p>`);
|
setValue("description_html", `${watch("description_html")}<p>${response}</p>`);
|
||||||
|
|
||||||
editorRef.current?.setEditorValue(watch("description_html") ?? "");
|
editorRef.current?.setEditorValue(watch("description_html") ?? "");
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue