From dc842449fdb1aabd252dc1ff56e310e8454bb830 Mon Sep 17 00:00:00 2001 From: Bartosz Grajdek Date: Thu, 7 Sep 2023 15:13:16 +0200 Subject: [PATCH] [TS migration] Migrate 'KeyboardShortcuts.js' lib to TypeScript --- .../actions/{KeyboardShortcuts.js => KeyboardShortcuts.ts} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename src/libs/actions/{KeyboardShortcuts.js => KeyboardShortcuts.ts} (82%) diff --git a/src/libs/actions/KeyboardShortcuts.js b/src/libs/actions/KeyboardShortcuts.ts similarity index 82% rename from src/libs/actions/KeyboardShortcuts.js rename to src/libs/actions/KeyboardShortcuts.ts index d66e362890b2..3f12f9fc92e1 100644 --- a/src/libs/actions/KeyboardShortcuts.js +++ b/src/libs/actions/KeyboardShortcuts.ts @@ -1,7 +1,7 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; -let isShortcutsModalOpen; +let isShortcutsModalOpen: boolean | null; Onyx.connect({ key: ONYXKEYS.IS_SHORTCUTS_MODAL_OPEN, callback: (flag) => (isShortcutsModalOpen = flag), @@ -11,7 +11,7 @@ Onyx.connect({ /** * Set keyboard shortcuts flag to show modal */ -function showKeyboardShortcutModal() { +function showKeyboardShortcutModal(): void { if (isShortcutsModalOpen) { return; } @@ -21,7 +21,7 @@ function showKeyboardShortcutModal() { /** * Unset keyboard shortcuts flag to hide modal */ -function hideKeyboardShortcutModal() { +function hideKeyboardShortcutModal(): void { if (!isShortcutsModalOpen) { return; }