Skip to content

Commit

Permalink
Merge pull request #29254 from dukenv0307/fix/28926
Browse files Browse the repository at this point in the history
Fix: App focuses back on composer even if RHN is open on copy link from app download link in about settings
  • Loading branch information
luacmartins authored Oct 12, 2023
2 parents 9b5f8c4 + 774396f commit 7bbee27
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 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,11 @@ function onComposerFocus(callback: FocusCallback, isMainComposer = false) {
* Request focus on the ReportActionComposer
*/
function focus() {
/** Do not trigger the refocusing when the active route is not the report route, */
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 7bbee27

Please sign in to comment.