check to make sure scrollPosition is defined

This commit is contained in:
Marty Alcala 2016-11-15 10:51:00 -05:00
commit f4bd7ea570

View file

@ -237,7 +237,14 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
var prevPos;
function getScrollPosition() {
var pos = $ionicScrollDelegate.getScrollPosition().top;
var scrollPosition = $ionicScrollDelegate.getScrollPosition();
if (!scrollPosition) {
$window.requestAnimationFrame(function() {
getScrollPosition();
});
return;
}
var pos = scrollPosition.top;
if (pos === prevPos) {
$window.requestAnimationFrame(function() {
getScrollPosition();