From e72386771751fb22245bc6604fef236a2ee130cb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 17 Dec 2019 18:07:48 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/diffs/components/app.vue | 5 +---- app/assets/javascripts/diffs/store/actions.js | 7 +++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'app/assets/javascripts/diffs') diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index 8fc8a8d0495..8ea443814e9 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -220,9 +220,6 @@ export default { this.assignedDiscussions = false; this.fetchData(false); }, - isLatestVersion() { - return window.location.search.indexOf('diff_id') === -1; - }, startDiffRendering() { requestIdleCallback( () => { @@ -232,7 +229,7 @@ export default { ); }, fetchData(toggleTree = true) { - if (this.isLatestVersion() && this.glFeatures.diffsBatchLoad) { + if (this.glFeatures.diffsBatchLoad) { this.fetchDiffFilesMeta() .then(() => { if (toggleTree) this.hideTreeListIfJustOneFile(); diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index 44672659f56..992b45c97ac 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -90,14 +90,13 @@ export const fetchDiffFiles = ({ state, commit }) => { }; export const fetchDiffFilesBatch = ({ commit, state }) => { - const baseUrl = `${state.endpointBatch}?per_page=${DIFFS_PER_PAGE}`; - const url = page => (page ? `${baseUrl}&page=${page}` : baseUrl); - commit(types.SET_BATCH_LOADING, true); const getBatch = page => axios - .get(url(page)) + .get(state.endpointBatch, { + params: { page, per_page: DIFFS_PER_PAGE, w: state.showWhitespace ? '0' : '1' }, + }) .then(({ data: { pagination, diff_files } }) => { commit(types.SET_DIFF_DATA_BATCH, { diff_files }); commit(types.SET_BATCH_LOADING, false); -- cgit v1.2.3