diff options
author | Phil Hughes <me@iamphill.com> | 2019-03-19 14:34:21 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-03-19 14:34:21 +0300 |
commit | 27fa7b9ca897c77e45878f3fecb7debe8f8cd64c (patch) | |
tree | 94a9ccb7ef7f4bd2ba7904d3b833e2d2f96adedb /app/assets/javascripts/diffs/store/actions.js | |
parent | a52d7dfaa9b72e4442a1723d30b84bc349b27215 (diff) |
Collapse diff tree is only one file is present
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53139
Diffstat (limited to 'app/assets/javascripts/diffs/store/actions.js')
-rw-r--r-- | app/assets/javascripts/diffs/store/actions.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index 4a04216d893..b58ae0d248c 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -266,9 +266,12 @@ export const scrollToFile = ({ state, commit }, path) => { commit(types.UPDATE_CURRENT_DIFF_FILE_ID, fileHash); }; -export const toggleShowTreeList = ({ commit, state }) => { +export const toggleShowTreeList = ({ commit, state }, saving = true) => { commit(types.TOGGLE_SHOW_TREE_LIST); - localStorage.setItem(MR_TREE_SHOW_KEY, state.showTreeList); + + if (saving) { + localStorage.setItem(MR_TREE_SHOW_KEY, state.showTreeList); + } }; export const openDiffFileCommentForm = ({ commit, getters }, formData) => { |