The use of splice() here caused buggy behavior and seemed to be a typo,
so I tried using slice() instead. But that still didn't work correctly.
The list stopped adding items after it reached 21 total, so scanning a
new barcode didn't add it to the list but only refreshed the list.
Instead, this commit sets the length of the array to 20, which shortens
the array as described in the MDN documentation for Array.length. Now it
behaves like it did in the XUL client.
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
}
if ($scope.trim_list && checkinSvc.checkins.length > 20)
- checkinSvc.checkins = checkinSvc.checkins.splice(0, 20);
+ //cut array short at 20 items
+ checkinSvc.checkins.length = 20;
},
function() {
// Checkin was rejected somewhere along the way.