Skip to content

Commit

Permalink
Build issue resolved (#81)
Browse files Browse the repository at this point in the history
* Fix-Removed commented out code for sonar quality improvement

* Fix-Removed commented out code for sonar quality improvement

* Fix-Removed commented out code for sonar quality improvement

* Fix-Refactor function

* Fix-Build issue

* Resolved merge conflict
  • Loading branch information
vidyaaKhandekar authored Dec 12, 2024
1 parent f8ada5f commit d6a9202
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/screens/benefit/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,6 @@ const BenefitsDetails: React.FC = () => {
return eligibilityArr;
};

const handleError = (e) => {
if (mounted) {
if (e instanceof Error) {
setError(`Error: ${e.message}`);
} else {
setError("An unexpected error occurred");
}
setLoading(false);
}
};
useEffect(() => {
let mounted = true;
const init = async () => {
Expand All @@ -233,7 +223,16 @@ const BenefitsDetails: React.FC = () => {
handleError(e);
}
};

const handleError = (e) => {
if (mounted) {
if (e instanceof Error) {
setError(`Error: ${e.message}`);
} else {
setError("An unexpected error occurred");
}
setLoading(false);
}
};
init();
return () => {
mounted = false;
Expand Down

0 comments on commit d6a9202

Please sign in to comment.