Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Nov 7, 2023
1 parent a24d9f0 commit a253dfc
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ const defaultProps = {
function reduceReportRoutes(routes) {
const result = [];
let count = 0;
routes.forEach((route) => {
const reverseRoutes = [...routes].reverse();

reverseRoutes.forEach((route) => {
if (route.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR) {
// Remove all report routes except the last 3. This will improve performance.
if (count < 3) {
result.push(route);
count++;
Expand All @@ -40,7 +43,7 @@ function reduceReportRoutes(routes) {
}
});

return result;
return result.reverse();
}

function ResponsiveStackNavigator(props) {
Expand Down

0 comments on commit a253dfc

Please sign in to comment.