diff options
author | Phil Hughes <me@iamphill.com> | 2017-11-01 16:26:10 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-11-06 10:52:03 +0000 |
commit | 5a2d9f66e28f54471b4d1cbfebe359152763a897 (patch) | |
tree | 75e61c935f0868e3b82e8e393880cf84641344a5 | |
parent | 054200062f1151fd31138305721d04798e8880b7 (diff) | |
download | gitlab-ce-5a2d9f66e28f54471b4d1cbfebe359152763a897.tar.gz |
only allow the call when not in collapsed view
[ci skip]
-rw-r--r-- | app/assets/javascripts/repo/stores/actions/file.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/repo/stores/actions/tree.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/repo/stores/actions/file.js b/app/assets/javascripts/repo/stores/actions/file.js index afbe0b78a82..5bae4fa826a 100644 --- a/app/assets/javascripts/repo/stores/actions/file.js +++ b/app/assets/javascripts/repo/stores/actions/file.js @@ -27,6 +27,8 @@ export const closeFile = ({ commit, state, dispatch }, { file, force = false }) } else if (!state.openFiles.length) { pushState(file.parentTreeUrl); } + + dispatch('getLastCommitData'); }; export const setFileActive = ({ commit, state, getters, dispatch }, file) => { diff --git a/app/assets/javascripts/repo/stores/actions/tree.js b/app/assets/javascripts/repo/stores/actions/tree.js index d8a09b52348..7e8b0b10322 100644 --- a/app/assets/javascripts/repo/stores/actions/tree.js +++ b/app/assets/javascripts/repo/stores/actions/tree.js @@ -111,8 +111,8 @@ export const createTempTree = ({ state, commit, dispatch }, name) => { } }; -export const getLastCommitData = ({ state, commit, dispatch }, tree = state) => { - if (tree.lastCommitPath === '') return; +export const getLastCommitData = ({ state, commit, dispatch, getters }, tree = state) => { + if (tree.lastCommitPath === '' || getters.isCollapsed) return; service.getTreeLastCommit(tree.lastCommitPath) .then((res) => { |