Skip to content

Commit

Permalink
adhoc fix (#1605)
Browse files Browse the repository at this point in the history
* Updates to bhargav's prs to avoid UI crashing

* Update SetupMicroplan.js
  • Loading branch information
nipunarora-eGov authored Oct 22, 2024
1 parent f82c5cb commit a9cfddd
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ const SetupMicroplan = ({ hierarchyType, hierarchyData }) => {
const handleUpdates = (propsForMutate) => {
updateResources(propsForMutate, {
onSuccess: (data) => {
if (data?.isState) {
if (data?.redirectTo) {
history.push(data?.redirectTo, data?.state)
} else {
history.push(data?.redirectTo)
}
}
},
onError: (error, variables) => {
setShowToast(({ key: "error", label: error?.message ? error.message : t("FAILED_TO_UPDATE_RESOURCE") }))
Expand Down Expand Up @@ -225,13 +223,13 @@ const goToPreviousScreenFromFormula = () => {


useEffect(() => {

window.addEventListener("revertToPreviousScreenFromFormula", goToPreviousScreenFromFormula);

return () => {
window.removeEventListener("revertToPreviousScreenFromFormula", goToPreviousScreenFromFormula);
};
}, []);


const onSecondayActionClick = () => {
if (currentKey === 1) {
history.push(`/${window.contextPath}/employee`);
Expand Down

0 comments on commit a9cfddd

Please sign in to comment.