Added check to execute code when first rendering modal. To work, it must merge with ModalRefactor
This commit is contained in:
parent
dc07b3c690
commit
43b23e4ef6
1 changed files with 4 additions and 1 deletions
|
|
@ -36,7 +36,6 @@ export default function CodeAreaModal({
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { dark } = useContext(darkContext);
|
const { dark } = useContext(darkContext);
|
||||||
const { setErrorData, setSuccessData } = useContext(alertContext);
|
const { setErrorData, setSuccessData } = useContext(alertContext);
|
||||||
const [activeTab, setActiveTab] = useState("0");
|
|
||||||
const [height, setHeight] = useState(null);
|
const [height, setHeight] = useState(null);
|
||||||
const [error, setError] = useState<{
|
const [error, setError] = useState<{
|
||||||
detail: { error: string; traceback: string };
|
detail: { error: string; traceback: string };
|
||||||
|
|
@ -55,6 +54,10 @@ export default function CodeAreaModal({
|
||||||
setValue(code);
|
setValue(code);
|
||||||
}, [code, setValue]);
|
}, [code, setValue]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleClick();
|
||||||
|
}, [])
|
||||||
|
|
||||||
function handleClick() {
|
function handleClick() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
if (!dynamic) {
|
if (!dynamic) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue