From a1274917276d8451f80dda40aeadff5587f39c0f Mon Sep 17 00:00:00 2001 From: Ayaz Alavi Date: Mon, 9 Oct 2023 20:47:28 +0500 Subject: [PATCH] added linting and prettier fix Signed-off-by: Ayaz Alavi --- src/libs/actions/InputFocus/index.desktop.ts | 9 ++++----- src/libs/actions/InputFocus/index.website.ts | 8 ++++---- .../ReportActionCompose/ComposerWithSuggestions.js | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/libs/actions/InputFocus/index.desktop.ts b/src/libs/actions/InputFocus/index.desktop.ts index f0548cd92725..b6cf1aba6138 100644 --- a/src/libs/actions/InputFocus/index.desktop.ts +++ b/src/libs/actions/InputFocus/index.desktop.ts @@ -1,6 +1,5 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../../ONYXKEYS'; -import * as Browser from '../../Browser'; import ReportActionComposeFocusManager from '../../ReportActionComposeFocusManager'; function inputFocusChange(focus: boolean) { @@ -8,18 +7,18 @@ function inputFocusChange(focus: boolean) { } let refSave: HTMLElement | undefined; -function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: { willAlertModalBecomeVisible: boolean; isVisible: boolean }, onyxFocused: boolean) { +function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: {willAlertModalBecomeVisible: boolean; isVisible: boolean}, onyxFocused: boolean) { if (isFocused && !onyxFocused) { inputFocusChange(true); ref.focus(); - } + } if (isFocused) { refSave = ref; } - if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) { + if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) { if (!ReportActionComposeFocusManager.isFocused()) { refSave.focus(); - } else { + } else { refSave = undefined; } } diff --git a/src/libs/actions/InputFocus/index.website.ts b/src/libs/actions/InputFocus/index.website.ts index 918aad939d72..17cb1fe2f44d 100644 --- a/src/libs/actions/InputFocus/index.website.ts +++ b/src/libs/actions/InputFocus/index.website.ts @@ -11,21 +11,21 @@ function inputFocusChange(focus: boolean) { } let refSave: HTMLElement | undefined; -function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: { willAlertModalBecomeVisible: boolean; isVisible: boolean }, onyxFocused: boolean) { +function composerFocusKeepFocusOn(ref: HTMLElement, isFocused: boolean, modal: {willAlertModalBecomeVisible: boolean; isVisible: boolean}, onyxFocused: boolean) { if (Browser.isMobile()) { return; } if (isFocused && !onyxFocused) { inputFocusChange(true); ref.focus(); - } + } if (isFocused) { refSave = ref; } - if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) { + if (!isFocused && !onyxFocused && !modal.willAlertModalBecomeVisible && !modal.isVisible && refSave) { if (!ReportActionComposeFocusManager.isFocused()) { refSave.focus(); - } else { + } else { refSave = undefined; } } diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js index a61f424f4bdd..7c1d8b2f14de 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions.js @@ -374,7 +374,7 @@ function ComposerWithSuggestions({ if (!suggestionsRef.current) { return false; } - InputFocus.inputFocusChange(false) + InputFocus.inputFocusChange(false); return suggestionsRef.current.setShouldBlockSuggestionCalc(false); }, [suggestionsRef]);