Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] [TS Migration] Migrate 'openReportActionComposeViewWhenClosingMessageEdit' lib to TypeScript #27312

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/libs/setShouldShowComposeInputKeyboardAware/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Keyboard} from 'react-native';
import {EmitterSubscription, Keyboard} from 'react-native';
import * as Composer from '../actions/Composer';
import SetShouldShowComposeInputKeyboardAware from './types';

let keyboardDidHideListener = null;
export default (shouldShow) => {
let keyboardDidHideListener: EmitterSubscription | null = null;
const setShouldShowComposeInputKeyboardAware: SetShouldShowComposeInputKeyboardAware = (shouldShow) => {
if (keyboardDidHideListener) {
keyboardDidHideListener.remove();
keyboardDidHideListener = null;
Expand All @@ -21,6 +22,8 @@ export default (shouldShow) => {

keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
Composer.setShouldShowComposeInput(true);
keyboardDidHideListener.remove();
keyboardDidHideListener?.remove();
});
};

export default setShouldShowComposeInputKeyboardAware;
8 changes: 8 additions & 0 deletions src/libs/setShouldShowComposeInputKeyboardAware/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as Composer from '../actions/Composer';
import SetShouldShowComposeInputKeyboardAware from './types';

const setShouldShowComposeInputKeyboardAware: SetShouldShowComposeInputKeyboardAware = (shouldShow) => {
Composer.setShouldShowComposeInput(shouldShow);
};

export default setShouldShowComposeInputKeyboardAware;
3 changes: 3 additions & 0 deletions src/libs/setShouldShowComposeInputKeyboardAware/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type SetShouldShowComposeInputKeyboardAware = (shouldShow: boolean) => void;

export default SetShouldShowComposeInputKeyboardAware;
Loading