removed console logs and improved structure

This commit is contained in:
Palanikannan1437 2023-10-26 14:48:39 +05:30
parent d714079c1c
commit 2ff953896d
2 changed files with 6 additions and 4 deletions

View File

@ -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;
}

View File

@ -51,7 +51,6 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = (props) => {
const [localValue, setLocalValue] = useState("");
const nameValue = watch("name");
useEffect(() => {
if (localValue === "" && nameValue !== "") {
setLocalValue(nameValue);