File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,18 @@ function getNonOptimisticPolicyIDs(policies) {
63
63
. value ( ) ;
64
64
}
65
65
66
+ /**
67
+ * @param {Array } policies
68
+ * @return {Object } map of policy id to lastUpdated
69
+ */
70
+ function getNonOptimisticPolicyIDToLastModifiedMap ( policies ) {
71
+ return _ . chain ( policies )
72
+ . reject ( ( policy ) => lodashGet ( policy , 'pendingAction' , '' ) === CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD )
73
+ . map ( ( policy ) => [ policy . id , policy . lastModified || 0 ] )
74
+ . object ( )
75
+ . value ( ) ;
76
+ }
77
+
66
78
/**
67
79
* @param {String } locale
68
80
*/
@@ -136,7 +148,7 @@ function openApp(isReconnecting = false) {
136
148
//
137
149
// - Look through the local report actions and reports to find the most recently modified report action or report.
138
150
// - We send this to the server so that it can compute which new chats the user needs to see and return only those as an optimization.
139
- const params = { policyIDList : getNonOptimisticPolicyIDs ( policies ) } ;
151
+ const params = { policyIDList : getNonOptimisticPolicyIDs ( policies ) , policyIDToLastModified : JSON . stringify ( getNonOptimisticPolicyIDToLastModifiedMap ( policies ) ) } ;
140
152
if ( isReconnecting ) {
141
153
Timing . start ( CONST . TIMING . CALCULATE_MOST_RECENT_LAST_MODIFIED_ACTION ) ;
142
154
params . mostRecentReportActionLastModified = ReportActionsUtils . getMostRecentReportActionLastModified ( ) ;
You can’t perform that action at this time.
0 commit comments