diff options
author | Fatih Acet <acetfatih@gmail.com> | 2018-06-29 07:22:07 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-06-29 07:22:07 +0000 |
commit | d690cd9992dbd6a0d231f6c7ea1688ef90f9fc2e (patch) | |
tree | 02df5a6d7e6711612180cb155dfad0944a7454ca /app/assets/javascripts/mr_notes | |
parent | 7c6d7accff0a4921d3c863a38382a6114ddb825e (diff) | |
download | gitlab-ce-d690cd9992dbd6a0d231f6c7ea1688ef90f9fc2e.tar.gz |
Prevent fetching diffs and discussions data unnecessarily on MR page
Diffstat (limited to 'app/assets/javascripts/mr_notes')
-rw-r--r-- | app/assets/javascripts/mr_notes/index.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/mr_notes/index.js b/app/assets/javascripts/mr_notes/index.js index 3c0c9995cc2..8aabb840847 100644 --- a/app/assets/javascripts/mr_notes/index.js +++ b/app/assets/javascripts/mr_notes/index.js @@ -45,17 +45,17 @@ export default function initMrNotes() { this.updateDiscussionTabCounter(); }, }, + created() { + this.setActiveTab(window.mrTabs.getCurrentAction()); + }, mounted() { this.notesCountBadge = $('.issuable-details').find('.notes-tab .badge'); - this.setActiveTab(window.mrTabs.getCurrentAction()); - - window.mrTabs.eventHub.$on('MergeRequestTabChange', tab => { - this.setActiveTab(tab); - }); $(document).on('visibilitychange', this.updateDiscussionTabCounter); + window.mrTabs.eventHub.$on('MergeRequestTabChange', this.setActiveTab); }, beforeDestroy() { $(document).off('visibilitychange', this.updateDiscussionTabCounter); + window.mrTabs.eventHub.$off('MergeRequestTabChange', this.setActiveTab); }, methods: { ...mapActions(['setActiveTab']), |