Merge branch 'notes-multiple-discussion-fetches' into 'master'

Stop multiple discussion requests

See merge request gitlab-org/gitlab-ce!22908
This commit is contained in:
Filipa Lacerda 2018-11-08 13:50:27 +00:00
commit bd3a793fb7
1 changed files with 6 additions and 0 deletions

View File

@ -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())