From 99ca310c73024b51fed1f3077375eed7827f2c20 Mon Sep 17 00:00:00 2001
From: Vijay A <vraravam@users.noreply.github.com>
Date: Sun, 28 May 2023 13:48:21 +0530
Subject: Fix issues reported by sonarqube linter

---
 src/components/ui/toggle/index.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'src/components/ui/toggle/index.tsx')

diff --git a/src/components/ui/toggle/index.tsx b/src/components/ui/toggle/index.tsx
index 828941886..48f68943b 100644
--- a/src/components/ui/toggle/index.tsx
+++ b/src/components/ui/toggle/index.tsx
@@ -16,10 +16,11 @@ interface IProps
   className?: string;
 }
 
-const buttonTransition: string =
-  window && window.matchMedia('(prefers-reduced-motion: no-preference)')
-    ? 'all .5s'
-    : 'none';
+const buttonTransition: string = window?.matchMedia(
+  '(prefers-reduced-motion: no-preference)',
+)
+  ? 'all .5s'
+  : 'none';
 
 const styles = (theme: Theme) => ({
   toggle: {
-- 
cgit v1.2.3-54-g00ecf

