forked from github/plane
fix: query checking (#2137)
fix: the logic should be to check if object exist not if it's true or false
This commit is contained in:
parent
1a37668f0b
commit
991258084e
@ -25,12 +25,7 @@ const Editor: NextPage = () => {
|
|||||||
|
|
||||||
const isEditable = editable === "true";
|
const isEditable = editable === "true";
|
||||||
|
|
||||||
const {
|
const { watch, setValue, control } = useForm({
|
||||||
watch,
|
|
||||||
setValue,
|
|
||||||
control,
|
|
||||||
formState: { errors },
|
|
||||||
} = useForm({
|
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
data: "",
|
data: "",
|
||||||
data_html: "",
|
data_html: "",
|
||||||
@ -39,11 +34,11 @@ const Editor: NextPage = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
if (!isEditable) return;
|
if (!router?.query?.["editable"]) return;
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
const data_html = Cookies.get("data_html");
|
const data_html = Cookies.get("data_html");
|
||||||
setValue("data_html", data_html ?? "");
|
setValue("data_html", data_html ?? "");
|
||||||
}, [isEditable, setValue]);
|
}, [isEditable, setValue, router]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WebViewLayout fullScreen={isLoading}>
|
<WebViewLayout fullScreen={isLoading}>
|
||||||
|
Loading…
Reference in New Issue
Block a user