summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/components/notes_app.vue
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-11-08 10:42:11 +0000
committerPhil Hughes <me@iamphill.com>2018-11-08 10:42:11 +0000
commit1519c3470ceb06329cbd1a53815d4c8adeb51bfb (patch)
treefbaef3f28e1f73155c01bf96c928994e88cdb540 /app/assets/javascripts/notes/components/notes_app.vue
parent369631c84195f6b8b26624d5647ae994e64b77e8 (diff)
downloadgitlab-ce-1519c3470ceb06329cbd1a53815d4c8adeb51bfb.tar.gz
Stop multiple discussion requestsnotes-multiple-discussion-fetches
With multiple discussion requests we loose the reactivity of the previously stored discussions state. This means that certain features, toggling line discussions for example, are no longer reactive.
Diffstat (limited to 'app/assets/javascripts/notes/components/notes_app.vue')
-rw-r--r--app/assets/javascripts/notes/components/notes_app.vue6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue
index ed5ac112dc0..e555279a6ac 100644
--- a/app/assets/javascripts/notes/components/notes_app.vue
+++ b/app/assets/javascripts/notes/components/notes_app.vue
@@ -50,6 +50,7 @@ export default {
},
data() {
return {
+ isFetching: false,
currentFilter: null,
};
},
@@ -141,6 +142,10 @@ export default {
return discussion.individual_note ? { note: discussion.notes[0] } : { discussion };
},
fetchNotes() {
+ if (this.isFetching) return null;
+
+ this.isFetching = true;
+
return this.fetchDiscussions({ path: this.getNotesDataByProp('discussionsPath') })
.then(() => {
this.initPolling();
@@ -149,6 +154,7 @@ export default {
this.setLoadingState(false);
this.setNotesFetchedState(true);
eventHub.$emit('fetchedNotesData');
+ this.isFetching = false;
})
.then(() => this.$nextTick())
.then(() => this.checkLocationHash())