Commit 9222b48d authored by Thomas Randolph's avatar Thomas Randolph

Use the Vuex store as the primary source of reviews

Previously, the localStorage storage was the authoritative source.
Now, the Vuex store is the authoritative source, with the localStorage
store being the "backup"/persistent store.

That means we need to push the localStorage values into the app,
but reserve the `mrReviews` property for the mapped state.
We do this by renaming the initial hydrator to "rehydratedMrReviews".
parent eadc6f28
......@@ -125,7 +125,7 @@ export default {
required: false,
default: '',
},
mrReviews: {
rehydratedMrReviews: {
type: Object,
required: false,
default: () => ({}),
......@@ -164,6 +164,7 @@ export default {
'canMerge',
'hasConflicts',
'viewDiffsFileByFile',
'mrReviews',
]),
...mapGetters('diffs', ['whichCollapsedTypes', 'isParallelView', 'currentDiffIndex']),
...mapGetters(['isNotesFetched', 'getNoteableData']),
......@@ -268,7 +269,7 @@ export default {
showSuggestPopover: this.showSuggestPopover,
viewDiffsFileByFile: fileByFile(this.fileByFileUserPreference),
defaultSuggestionCommitMessage: this.defaultSuggestionCommitMessage,
mrReviews: this.mrReviews || {},
mrReviews: this.rehydratedMrReviews,
});
if (this.shouldShow) {
......
......@@ -124,7 +124,7 @@ export default function initDiffsApp(store) {
showSuggestPopover: this.showSuggestPopover,
fileByFileUserPreference: this.viewDiffsFileByFile,
defaultSuggestionCommitMessage: this.defaultSuggestionCommitMessage,
mrReviews: getReviewsForMergeRequest(mrPath),
rehydratedMrReviews: getReviewsForMergeRequest(mrPath),
},
});
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment