Commit a4ddb993 authored by Phil Hughes's avatar Phil Hughes

Only renders notes tab when viewing discussions

Instead of always rendering the overview tab, this changes it to
only render the discussions whenever the user is viewing the overview
tab. Doing this helps save memory, especially on much larger
merge requests.
parent 71bea374
......@@ -66,6 +66,7 @@ export default {
data() {
return {
currentFilter: null,
renderSkeleton: !this.shouldShow,
};
},
computed: {
......@@ -93,7 +94,7 @@ export default {
return this.noteableData.noteableType;
},
allDiscussions() {
if (this.isLoading) {
if (this.renderSkeleton || this.isLoading) {
const prerenderedNotesCount = parseInt(this.notesData.prerenderedNotesCount, 10) || 0;
return new Array(prerenderedNotesCount).fill({
......@@ -122,6 +123,10 @@ export default {
if (!this.isNotesFetched) {
this.fetchNotes();
}
setTimeout(() => {
this.renderSkeleton = !this.shouldShow;
});
},
discussionTabCounterText(val) {
if (this.discussionsCount) {
......
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