diff options
Diffstat (limited to 'app/assets/javascripts/notes/stores/getters.js')
-rw-r--r-- | app/assets/javascripts/notes/stores/getters.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes/stores/getters.js b/app/assets/javascripts/notes/stores/getters.js index 956221d69ae..a710ac0ccf5 100644 --- a/app/assets/javascripts/notes/stores/getters.js +++ b/app/assets/javascripts/notes/stores/getters.js @@ -283,3 +283,14 @@ export const suggestionsCount = (state, getters) => export const hasDrafts = (state, getters, rootState, rootGetters) => Boolean(rootGetters['batchComments/hasDrafts']); + +export const getSuggestionsFilePaths = (state) => () => + state.batchSuggestionsInfo.reduce((acc, suggestion) => { + const discussion = state.discussions.find((d) => d.id === suggestion.discussionId); + + if (acc.indexOf(discussion?.diff_file?.file_path) === -1) { + acc.push(discussion.diff_file.file_path); + } + + return acc; + }, []); |