File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,7 @@ function save(requestsToPersist) {
25
25
* @param {Object } requestToRemove
26
26
*/
27
27
function remove ( requestToRemove ) {
28
- /**
29
- * We only remove the first matching request because the order of requests matters.
30
- * If we were to remove all matching requests, we can end up with a final state that is different than what the user intended.
31
- */
32
- const index = _ . findIndex ( persistedRequests , ( persistedRequest ) => _ . isEqual ( persistedRequest , requestToRemove ) ) ;
33
- if ( index !== - 1 ) {
34
- persistedRequests . splice ( index , 1 ) ;
35
- }
36
-
28
+ persistedRequests = _ . reject ( persistedRequests , ( persistedRequest ) => _ . isEqual ( persistedRequest , requestToRemove ) ) ;
37
29
Onyx . set ( ONYXKEYS . PERSISTED_REQUESTS , persistedRequests ) ;
38
30
}
39
31
You can’t perform that action at this time.
0 commit comments