From 94cd8703b3f49d99f3b670c2138fd4af6a324a29 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 1 Jul 2023 17:09:04 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(App.tsx):=20improve=20code?= =?UTF-8?q?=20readability=20by=20formatting=20long=20conditional=20stateme?= =?UTF-8?q?nts=20The=20conditional=20statements=20in=20the=20useEffect=20h?= =?UTF-8?q?ook=20were=20formatted=20to=20improve=20code=20readability.=20B?= =?UTF-8?q?y=20breaking=20the=20statements=20into=20multiple=20lines=20and?= =?UTF-8?q?=20adding=20proper=20indentation,=20it=20is=20easier=20to=20und?= =?UTF-8?q?erstand=20the=20logic.=20This=20change=20does=20not=20affect=20?= =?UTF-8?q?the=20functionality=20of=20the=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/App.tsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 3ef728925..166baf4c7 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -51,7 +51,11 @@ export default function App() { useEffect(() => { // If there is an error alert open with data, add it to the alertsList if (errorOpen && errorData) { - if(alertsList.length > 0 && JSON.stringify(alertsList[alertsList.length - 1].data)===JSON.stringify(errorData)){ + if ( + alertsList.length > 0 && + JSON.stringify(alertsList[alertsList.length - 1].data) === + JSON.stringify(errorData) + ) { return; } setErrorOpen(false); @@ -65,7 +69,11 @@ export default function App() { } // If there is a notice alert open with data, add it to the alertsList else if (noticeOpen && noticeData) { - if(alertsList.length > 0 && JSON.stringify(alertsList[alertsList.length - 1].data)===JSON.stringify(noticeData)){ + if ( + alertsList.length > 0 && + JSON.stringify(alertsList[alertsList.length - 1].data) === + JSON.stringify(noticeData) + ) { return; } setNoticeOpen(false); @@ -79,7 +87,11 @@ export default function App() { } // If there is a success alert open with data, add it to the alertsList else if (successOpen && successData) { - if(alertsList.length > 0 && JSON.stringify(alertsList[alertsList.length - 1].data)===JSON.stringify(successData)){ + if ( + alertsList.length > 0 && + JSON.stringify(alertsList[alertsList.length - 1].data) === + JSON.stringify(successData) + ) { return; } setSuccessOpen(false); @@ -161,4 +173,4 @@ export default function App() { ); -} \ No newline at end of file +}