@@ -9,7 +9,6 @@ import Timing from '../../../libs/actions/Timing';
9
9
import CONST from '../../../CONST' ;
10
10
import compose from '../../../libs/compose' ;
11
11
import withWindowDimensions , { windowDimensionsPropTypes } from '../../../components/withWindowDimensions' ;
12
- import { withDrawerPropTypes } from '../../../components/withDrawerState' ;
13
12
import * as ReportScrollManager from '../../../libs/ReportScrollManager' ;
14
13
import withLocalize , { withLocalizePropTypes } from '../../../components/withLocalize' ;
15
14
import Performance from '../../../libs/Performance' ;
@@ -23,6 +22,7 @@ import EmojiPicker from '../../../components/EmojiPicker/EmojiPicker';
23
22
import * as ReportActionsUtils from '../../../libs/ReportActionsUtils' ;
24
23
import * as ReportUtils from '../../../libs/ReportUtils' ;
25
24
import reportPropTypes from '../../reportPropTypes' ;
25
+ import withNavigationFocus from '../../../components/withNavigationFocus' ;
26
26
27
27
const propTypes = {
28
28
/** The report currently being looked at */
@@ -38,7 +38,6 @@ const propTypes = {
38
38
network : networkPropTypes . isRequired ,
39
39
40
40
...windowDimensionsPropTypes ,
41
- ...withDrawerPropTypes ,
42
41
...withLocalizePropTypes ,
43
42
} ;
44
43
@@ -154,10 +153,6 @@ class ReportActionsView extends React.Component {
154
153
return true ;
155
154
}
156
155
157
- if ( this . props . isDrawerOpen !== nextProps . isDrawerOpen ) {
158
- return true ;
159
- }
160
-
161
156
if ( lodashGet ( this . props . report , 'hasOutstandingIOU' ) !== lodashGet ( nextProps . report , 'hasOutstandingIOU' ) ) {
162
157
return true ;
163
158
}
@@ -186,9 +181,8 @@ class ReportActionsView extends React.Component {
186
181
187
182
// If the report was previously hidden by the side bar, or the view is expanded from mobile to desktop layout
188
183
// we update the new marker position, mark the report as read, and fetch new report actions
189
- const didSidebarClose = prevProps . isDrawerOpen && ! this . props . isDrawerOpen ;
190
184
const didScreenSizeIncrease = prevProps . isSmallScreenWidth && ! this . props . isSmallScreenWidth ;
191
- const didReportBecomeVisible = isReportFullyVisible && ( didSidebarClose || didScreenSizeIncrease ) ;
185
+ const didReportBecomeVisible = isReportFullyVisible && didScreenSizeIncrease ;
192
186
if ( didReportBecomeVisible ) {
193
187
this . setState ( {
194
188
newMarkerReportActionID : ReportUtils . isUnread ( this . props . report )
@@ -206,14 +200,6 @@ class ReportActionsView extends React.Component {
206
200
} ) ;
207
201
}
208
202
209
- // When the user navigates to the LHN the ReportActionsView doesn't unmount and just remains hidden.
210
- // The next time we navigate to the same report (e.g. by swiping or tapping the LHN row) we want the new marker to clear.
211
- const didSidebarOpen = ! prevProps . isDrawerOpen && this . props . isDrawerOpen ;
212
- const didUserNavigateToSidebarAfterReadingReport = didSidebarOpen && ! ReportUtils . isUnread ( this . props . report ) ;
213
- if ( didUserNavigateToSidebarAfterReadingReport ) {
214
- this . setState ( { newMarkerReportActionID : '' } ) ;
215
- }
216
-
217
203
// Checks to see if a report comment has been manually "marked as unread". All other times when the lastReadTime
218
204
// changes it will be because we marked the entire report as read.
219
205
const didManuallyMarkReportAsUnread = ( prevProps . report . lastReadTime !== this . props . report . lastReadTime )
@@ -250,7 +236,7 @@ class ReportActionsView extends React.Component {
250
236
* @returns {Boolean }
251
237
*/
252
238
getIsReportFullyVisible ( ) {
253
- const isSidebarCoveringReportView = this . props . isSmallScreenWidth && this . props . isDrawerOpen ;
239
+ const isSidebarCoveringReportView = this . props . isSmallScreenWidth && ! this . props . isFocused ;
254
240
return Visibility . isVisible ( ) && ! isSidebarCoveringReportView ;
255
241
}
256
242
@@ -366,6 +352,7 @@ ReportActionsView.defaultProps = defaultProps;
366
352
export default compose (
367
353
Performance . withRenderTrace ( { id : '<ReportActionsView> rendering' } ) ,
368
354
withWindowDimensions ,
355
+ withNavigationFocus ,
369
356
withLocalize ,
370
357
withNetwork ( ) ,
371
358
) ( ReportActionsView ) ;
0 commit comments