diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 21:08:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 21:08:38 +0300 |
commit | e3f2c7cf9e327f6f6003e378593c2970f63f8d0d (patch) | |
tree | afe6cae1871270555093e37aecdc65eec71b0982 /app/assets/javascripts/merge_request_tabs.js | |
parent | 4564f677f8d71e814e89618e81709c86cf50e3d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index b927654a3f5..eb25879205f 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -482,12 +482,14 @@ export default class MergeRequestTabs { axios .get(`${source}.json`, { params: { page, per_page: 100 } }) - .then(({ data }) => { + .then(({ data: { html, count, next_page: nextPage } }) => { toggleLoader(false); + document.querySelector('.js-commits-count').textContent = count; + const commitsDiv = document.querySelector('div#commits'); // eslint-disable-next-line no-unsanitized/property - commitsDiv.innerHTML += data.html; + commitsDiv.innerHTML += html; localTimeAgo(commitsDiv.querySelectorAll('.js-timeago')); this.commitsLoaded = true; scrollToContainer('#commits'); @@ -503,7 +505,7 @@ export default class MergeRequestTabs { }); } - if (!data.next_page) { + if (!nextPage) { return import('./add_context_commits_modal'); } |