fix: pages 'I'm feeling lucky' not working (#1058)

This commit is contained in:
Dakshesh Jain 2023-05-19 15:13:33 +05:30 committed by GitHub
parent 06618006c2
commit 4ce5a450d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,7 +146,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
})
.then((res) => {
mutate(PAGE_BLOCKS_LIST(pageId as string));
editorRef.current?.setEditorValue(res.description);
editorRef.current?.setEditorValue(res.description_html);
if (data.issue && data.sync)
issuesService
.patchIssue(workspaceSlug as string, projectId as string, data.issue, {
@ -184,6 +184,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
else {
setValue("description", {});
setValue("description_html", `${watch("description_html") ?? ""}<p>${res.response}</p>`);
editorRef.current?.setEditorValue(watch("description_html") ?? "");
}
})
.catch((err) => {
@ -276,7 +277,10 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
if (!data)
return (
<WrappedRemirrorRichTextEditor
value={value}
value={{
type: "doc",
content: [{ type: "paragraph" }],
}}
onJSONChange={(jsonValue) => setValue("description", jsonValue)}
onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)}
placeholder="Write something..."
@ -292,7 +296,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
);
return (
<RemirrorRichTextEditor
<WrappedRemirrorRichTextEditor
value={
value && value !== "" && Object.keys(value).length > 0
? value
@ -306,6 +310,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
customClassName="text-sm"
noBorder
borderOnFocus={false}
ref={editorRef}
/>
);
}}