Skip to content

Commit be9ba30

Browse files
Fixed more reviews on ReportActionsView
1 parent 89cb715 commit be9ba30

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/pages/home/report/ReportActionsView.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
View,
55
Keyboard,
66
AppState,
7-
Easing,
87
} from 'react-native';
98
import PropTypes from 'prop-types';
109
import _ from 'underscore';
@@ -65,10 +64,15 @@ class ReportActionsView extends React.Component {
6564

6665
this.sortedReportActions = [];
6766
this.timers = [];
68-
this.unreadActionCount = 0;
69-
this.shouldShowNewActionIndicator = true;
7067
this.unreadIndicatorOpacity = new Animated.Value(1);
7168

69+
// Helper variable that keeps track of the unread action count before it updates to zero
70+
this.unreadActionCount = 0;
71+
72+
// Helper variable that prevents the unread indicator to show up for new messages
73+
// received while the report is still active
74+
this.shouldShowUnreadActionIndicator = true;
75+
7276
this.state = {
7377
refetchNeeded: true,
7478
};
@@ -171,7 +175,7 @@ class ReportActionsView extends React.Component {
171175
* a flag to not show it again if the report is still open
172176
*/
173177
setUpUnreadActionIndicator() {
174-
if (!this.props.isActiveReport || !this.shouldShowNewActionIndicator) {
178+
if (!this.props.isActiveReport || !this.shouldShowUnreadActionIndicator) {
175179
return;
176180
}
177181

@@ -182,14 +186,12 @@ class ReportActionsView extends React.Component {
182186
this.timers.push(setTimeout(() => {
183187
Animated.timing(this.unreadIndicatorOpacity, {
184188
toValue: 0,
185-
duration: 500,
186-
easing: Easing.ease,
187189
useNativeDriver: false,
188190
}).start();
189191
}, 3000));
190192
}
191193

192-
this.shouldShowNewActionIndicator = false;
194+
this.shouldShowUnreadActionIndicator = false;
193195
}
194196

195197
/**

0 commit comments

Comments
 (0)