From 8f775bf710fca7477e49003bf16610c508cd393a Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 3 Oct 2026 12:27:31 -0400 Subject: [PATCH] refactor(sonar): prefer optional chaining (S6582) --- src/renderer/routes/Login.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/routes/Login.tsx b/src/renderer/routes/Login.tsx index 0775fece1..1a20ae25d 100644 --- a/src/renderer/routes/Login.tsx +++ b/src/renderer/routes/Login.tsx @@ -60,7 +60,7 @@ export const LoginRoute: FC = () => { width: btnRect.width, }; // Avoid setState->layout->setState loops when nothing changed. - if (prev && prev.left === next.left && prev.width === next.width) { + if (prev?.left === next.left && prev?.width === next.width) { return prev; } return next;