Skip to content

Commit

Permalink
Merge f2dc102 into 080ba83
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-lara committed Jan 24, 2020
2 parents 080ba83 + f2dc102 commit a68b24f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ angular.module('BE.seed.controller.inventory_list', [])
$scope.data = [];
var lastCycleId = inventory_service.get_last_cycle();
$scope.cycle = {
selected_cycle: lastCycleId ? _.find(cycles.cycles, {id: lastCycleId}) : _.first(cycles.cycles),
selected_cycle: _.find(cycles.cycles, {id: lastCycleId}) || _.first(cycles.cycles),
cycles: cycles.cycles
};

Expand Down
3 changes: 1 addition & 2 deletions seed/static/seed/js/controllers/inventory_map_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ angular.module('BE.seed.controller.inventory_map', [])

var lastCycleId = inventory_service.get_last_cycle();
$scope.cycle = {
selected_cycle: lastCycleId ? _.find(cycles.cycles, {id: lastCycleId}) : _.first(cycles.cycles),
selected_cycle: _.find(cycles.cycles, {id: lastCycleId}) || _.first(cycles.cycles),
cycles: cycles.cycles
};

Expand Down Expand Up @@ -614,4 +614,3 @@ angular.module('BE.seed.controller.inventory_map', [])
};
});
}]);

2 changes: 1 addition & 1 deletion seed/static/seed/js/controllers/pairing_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ angular.module('BE.seed.controller.pairing', []).controller('pairing_controller'

var lastCycleId = inventory_service.get_last_cycle();
$scope.cycle = {
selected_cycle: lastCycleId ? _.find(cycles.cycles, {id: lastCycleId}) : _.first(cycles.cycles),
selected_cycle: _.find(cycles.cycles, {id: lastCycleId}) || _.first(cycles.cycles),
cycles: cycles.cycles
};

Expand Down

0 comments on commit a68b24f

Please sign in to comment.