Skip to content

Commit 1a0d168

Browse files
committed
cancel interval on error throwing
1 parent 16941ab commit 1a0d168

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ui-scroll.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ angular.module('ui.scroll', [])
6969
const PADDING_MIN = 0.3;
7070
const PADDING_DEFAULT = 0.5;
7171
const MAX_VIEWPORT_DELAY = 500;
72-
const VIEWPORT_POLLING_INTERVAL = 75;
72+
const VIEWPORT_POLLING_INTERVAL = 50;
7373

7474
let datasource = null;
7575
const itemName = match[1];
@@ -170,6 +170,7 @@ angular.module('ui.scroll', [])
170170
reload();
171171
}
172172
if(tryCount * VIEWPORT_POLLING_INTERVAL >= MAX_VIEWPORT_DELAY) {
173+
$interval.cancel(timer);
173174
throw Error(`ui-scroll directive requires a viewport with non-zero height in ${MAX_VIEWPORT_DELAY}ms`);
174175
}
175176
}, VIEWPORT_POLLING_INTERVAL);

0 commit comments

Comments
 (0)