diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-07-17 12:54:33 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-07-31 09:24:36 +0100 |
commit | 32de37536e29d2acb1d1ddb8e92b59c493470059 (patch) | |
tree | fbcaf2c95af6bbf67a682eac04072ec4bbaf61af /app/assets/javascripts/diffs/store/getters.js | |
parent | ff060ad4056494d32c00a06b134b1f4e20751e19 (diff) | |
download | gitlab-ce-32de37536e29d2acb1d1ddb8e92b59c493470059.tar.gz |
Disables toggle comments button for diff with no discussions
Diffstat (limited to 'app/assets/javascripts/diffs/store/getters.js')
-rw-r--r-- | app/assets/javascripts/diffs/store/getters.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index c7b9b1a16e6..fc1d15b8d54 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -48,6 +48,14 @@ export const diffHasExpandedDiscussions = (state, getters) => diff => { }; /** + * Checks if the diff has any discussion + * @param {Boolean} diff + * @returns {Boolean} + */ +export const diffHasDiscussions = (state, getters) => diff => + getters.getDiffFileDiscussions(diff).length > 0; + +/** * Returns an array with the discussions of the given diff * @param {Object} diff * @returns {Array} |