From 99ca310c73024b51fed1f3077375eed7827f2c20 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 28 May 2023 13:48:21 +0530 Subject: Fix issues reported by sonarqube linter --- src/features/webControls/components/WebControls.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/features/webControls/components') diff --git a/src/features/webControls/components/WebControls.tsx b/src/features/webControls/components/WebControls.tsx index 74b343948..e76fca6a2 100644 --- a/src/features/webControls/components/WebControls.tsx +++ b/src/features/webControls/components/WebControls.tsx @@ -34,10 +34,11 @@ const messages = defineMessages({ }, }); -const buttonTransition = - window && window.matchMedia('(prefers-reduced-motion: no-preference)') - ? 'opacity 0.25s' - : 'none'; +const buttonTransition = window?.matchMedia( + '(prefers-reduced-motion: no-preference)', +) + ? 'opacity 0.25s' + : 'none'; const styles = theme => ({ root: { @@ -211,7 +212,7 @@ class WebControls extends Component { }); navigate(inputUrl); - if (this.inputRef && this.inputRef.current) { + if (this.inputRef?.current) { this.inputRef.current.blur(); } } else if (event.key === 'Escape') { @@ -220,7 +221,7 @@ class WebControls extends Component { inputUrl: url, }); - if (this.inputRef && this.inputRef.current) { + if (this.inputRef?.current) { this.inputRef.current.blur(); } } -- cgit v1.2.3-70-g09d2