Commit 9939b613 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'gitlab-org/gitlab-ce#41738' into 'master'

Fix if-check

See merge request gitlab-org/gitlab-ce!20640
parents 7a0e2426 c4d2db1f
......@@ -203,7 +203,7 @@ export default {
this.showIssueForm = !this.showIssueForm;
},
onScroll() {
if (!this.loadingMore && (this.scrollTop() > this.scrollHeight() - this.scrollOffset)) {
if (!this.list.loadingMore && (this.scrollTop() > this.scrollHeight() - this.scrollOffset)) {
this.loadNextPage();
}
},
......
---
title: "Fix If-Check the result that a function was executed several times"
merge_request: 20640
author: Max Dicker
type: fixed
......@@ -200,6 +200,15 @@ describe('Board list component', () => {
});
});
it('does not load issues if already loading', () => {
component.list.nextPage = spyOn(component.list, 'nextPage').and.returnValue(new Promise(() => {}));
component.onScroll();
component.onScroll();
expect(component.list.nextPage).toHaveBeenCalledTimes(1);
});
it('shows loading more spinner', (done) => {
component.showCount = true;
component.list.loadingMore = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment