Skip to content
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
4 changes: 3 additions & 1 deletion src/libs/Visibility/index.native.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// Mobile apps do not require this check for visibility as
// they do not use the Notification lib.

import {AppState} from 'react-native';

/**
* @return {Boolean}
*/
const isVisible = () => true;
const isVisible = () => AppState.currentState === 'active';

export default {
isVisible,
Expand Down
10 changes: 8 additions & 2 deletions src/pages/home/report/ReportActionsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ class ReportActionsView extends React.Component {
this.scrollToListBottom();
}
});
updateLastReadActionID(this.props.reportID);

// Only mark as read if the report is open
if (!this.props.isDrawerOpen) {
updateLastReadActionID(this.props.reportID);
Comment thread
meetmangukiya marked this conversation as resolved.
}

this.updateUnreadIndicatorPosition(this.props.report.unreadActionCount);
fetchActions(this.props.reportID);
}
Expand Down Expand Up @@ -229,7 +234,8 @@ class ReportActionsView extends React.Component {
* Records the max action on app visibility change event.
*/
onVisibilityChange() {
if (Visibility.isVisible()) {
// only mark as read if visible AND report is open.
if (Visibility.isVisible() && !this.props.isDrawerOpen) {
updateLastReadActionID(this.props.reportID);
}
}
Expand Down