forked from github/plane
removed console logs and improved structure
This commit is contained in:
parent
d714079c1c
commit
2ff953896d
@ -1,5 +1,10 @@
|
||||
import { useEditor as useCustomEditor, Editor } from "@tiptap/react";
|
||||
import { useImperativeHandle, useRef, MutableRefObject, useEffect } from "react";
|
||||
import {
|
||||
useImperativeHandle,
|
||||
useRef,
|
||||
MutableRefObject,
|
||||
useEffect,
|
||||
} from "react";
|
||||
import { CoreReadOnlyEditorExtensions } from "../../ui/read-only/extensions";
|
||||
import { CoreReadOnlyEditorProps } from "../../ui/read-only/props";
|
||||
import { EditorProps } from "@tiptap/pm/view";
|
||||
@ -29,10 +34,8 @@ export const useReadOnlyEditor = ({
|
||||
});
|
||||
|
||||
const hasIntiliazedContent = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (editor && !value && !hasIntiliazedContent.current) {
|
||||
console.log("setting content");
|
||||
editor.commands.setContent(value);
|
||||
hasIntiliazedContent.current = true;
|
||||
}
|
||||
|
@ -51,7 +51,6 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = (props) => {
|
||||
|
||||
const [localValue, setLocalValue] = useState("");
|
||||
const nameValue = watch("name");
|
||||
|
||||
useEffect(() => {
|
||||
if (localValue === "" && nameValue !== "") {
|
||||
setLocalValue(nameValue);
|
||||
|
Loading…
Reference in New Issue
Block a user