Skip to content

Commit

Permalink
fix: 28926
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Oct 5, 2023
1 parent 567c32e commit 6703162
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libs/ReportActionComposeFocusManager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import {TextInput} from 'react-native';
import ROUTES from '../ROUTES';
import Navigation from './Navigation/Navigation';

type FocusCallback = () => void;

Expand Down Expand Up @@ -28,6 +30,10 @@ function onComposerFocus(callback: FocusCallback, isMainComposer = false) {
* Request focus on the ReportActionComposer
*/
function focus() {
if (!Navigation.isActiveRoute(ROUTES.REPORT_WITH_ID.getRoute(Navigation.getTopmostReportId() ?? ''))) {
return;
}

if (typeof focusCallback !== 'function') {
if (typeof mainComposerFocusCallback !== 'function') {
return;
Expand Down

0 comments on commit 6703162

Please sign in to comment.