diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-08-13 12:55:30 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-09-07 13:25:50 +0300 |
commit | 6f46b274e66908860833521a7b1e440e9acc4aaa (patch) | |
tree | bac2fac8f6804818ab01d404f93994c093be2bb6 /app/assets/javascripts/diffs/components/app.vue | |
parent | 95c8e747db56d527d94301fbbd2ebe98d180f696 (diff) |
Updated discussion loading to be deferred and in the state
Diffstat (limited to 'app/assets/javascripts/diffs/components/app.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/app.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index b801dd56392..da7125c604b 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -112,7 +112,6 @@ export default { }, created() { this.adjustView(); - eventHub.$once('renderedFiles', this.assignDiscussionsToDiff); }, methods: { ...mapActions('diffs', [ @@ -130,7 +129,12 @@ export default { this.startRenderDiffsQueue() .then(() => { console.log('Done rendering Que'); - this.assignDiscussionsToDiff(this.discussionsStructuredByLineCode); + requestIdleCallback( + () => { + this.assignDiscussionsToDiff(this.discussionsStructuredByLineCode); + }, + { timeout: 1000 }, + ); }) .catch(() => { createFlash(__('Something went wrong on our end. Please try again!')); |