summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/components
diff options
context:
space:
mode:
authorIgor Drozdov <idrozdov@gitlab.com>2019-08-26 02:55:00 +0300
committerIgor Drozdov <idrozdov@gitlab.com>2019-08-28 08:30:13 +0300
commit72544449cfb8e35b8c044f5bfd08a2fae2253408 (patch)
tree9fb30b7c20955968f090a9f61582ad737f9afc4b /app/assets/javascripts/notes/components
parent7671c592f826f44be5a8a7dc947fba467f5df851 (diff)
downloadgitlab-ce-72544449cfb8e35b8c044f5bfd08a2fae2253408.tar.gz
Change the way totalNotes is calculatedid-change-total-notes-calculation
totalNotes is only used to prerender a number of skeleton containers until real notes are loaded issuable.discussions makes multiple requests, so too expensive for this This commit uses mere notes for this and sends actual totalNotes number if it's less than 10; otherwise it sends 10 - it allows us to avoid bunch of skeleton prerenderings, which are not necessary since they doesn't fit into the whole screen and disappear quite fast
Diffstat (limited to 'app/assets/javascripts/notes/components')
-rw-r--r--app/assets/javascripts/notes/components/notes_app.vue4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue
index a0695f9e191..16a0fb3f33a 100644
--- a/app/assets/javascripts/notes/components/notes_app.vue
+++ b/app/assets/javascripts/notes/components/notes_app.vue
@@ -75,9 +75,9 @@ export default {
},
allDiscussions() {
if (this.isLoading) {
- const totalNotes = parseInt(this.notesData.totalNotes, 10) || 0;
+ const prerenderedNotesCount = parseInt(this.notesData.prerenderedNotesCount, 10) || 0;
- return new Array(totalNotes).fill({
+ return new Array(prerenderedNotesCount).fill({
isSkeletonNote: true,
});
}