diff options
3 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue index 3e610a4088c..bfc8d9b03ad 100644 --- a/app/assets/javascripts/boards/components/board_list.vue +++ b/app/assets/javascripts/boards/components/board_list.vue @@ -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(); } }, diff --git a/changelogs/unreleased/41738-fix-sorting-issues-is-wrong-in-list-with-pagination.yml b/changelogs/unreleased/41738-fix-sorting-issues-is-wrong-in-list-with-pagination.yml new file mode 100644 index 00000000000..bc0150c6586 --- /dev/null +++ b/changelogs/unreleased/41738-fix-sorting-issues-is-wrong-in-list-with-pagination.yml @@ -0,0 +1,5 @@ +---
+title: "Fix If-Check the result that a function was executed several times"
+merge_request: 20640
+author: Max Dicker
+type: fixed
diff --git a/spec/javascripts/boards/board_list_spec.js b/spec/javascripts/boards/board_list_spec.js index de261d36c61..290600cf995 100644 --- a/spec/javascripts/boards/board_list_spec.js +++ b/spec/javascripts/boards/board_list_spec.js @@ -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; |