From eb488e374ba598ffb56ce76c9e9df47f3f9d5f4e Mon Sep 17 00:00:00 2001 From: Nuwan Date: Mon, 11 Mar 2024 07:27:00 +0530 Subject: [PATCH] profile page update synchronously. making this chage to fetch all the data that need to be present for the page on initial loading --- jam-ui/src/components/page/JKEditProfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jam-ui/src/components/page/JKEditProfile.js b/jam-ui/src/components/page/JKEditProfile.js index bb3a0a08c..d9fd5e908 100644 --- a/jam-ui/src/components/page/JKEditProfile.js +++ b/jam-ui/src/components/page/JKEditProfile.js @@ -1,4 +1,4 @@ -import React, { useRef, useEffect, useState, useReducer } from 'react'; +import React, { useRef, useEffect, useLayoutEffect, useState, useReducer } from 'react'; import { Card, CardBody, Col, Row, CardHeader, Form, FormGroup, Label, Input, Button } from 'reactstrap'; import Select from 'react-select'; import FalconCardHeader from '../common/FalconCardHeader'; @@ -60,7 +60,7 @@ function JKEditProfile() { } }); - useEffect(() => { + useLayoutEffect(() => { if (currentUser && !currentUserLoaded) { setCurrentUserLoaded(true); fetchCurentUser().then(data => {