Added check to execute code when first rendering modal. To work, it must merge with ModalRefactor

This commit is contained in:
Lucas Oliveira 2023-07-16 16:18:40 -03:00
commit 43b23e4ef6

View file

@ -36,7 +36,6 @@ export default function CodeAreaModal({
const [loading, setLoading] = useState(false);
const { dark } = useContext(darkContext);
const { setErrorData, setSuccessData } = useContext(alertContext);
const [activeTab, setActiveTab] = useState("0");
const [height, setHeight] = useState(null);
const [error, setError] = useState<{
detail: { error: string; traceback: string };
@ -55,6 +54,10 @@ export default function CodeAreaModal({
setValue(code);
}, [code, setValue]);
useEffect(() => {
handleClick();
}, [])
function handleClick() {
setLoading(true);
if (!dynamic) {