diff options
author | Phil Hughes <me@iamphill.com> | 2019-02-18 15:16:04 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-02-18 15:16:04 +0000 |
commit | 512f9624fa8b47480da4cd0a69a493d7ccecc65a (patch) | |
tree | 33d31a6f133e6c5e5291b0dbe8c012537b958d77 /app/assets/javascripts/diffs/components/diff_file.vue | |
parent | 8f2221a8b0a2891e6368a4595f19f0dbc7681c53 (diff) | |
download | gitlab-ce-512f9624fa8b47480da4cd0a69a493d7ccecc65a.tar.gz |
Fix diff files not rendering
Fixes some diff files not rendering when the renderIt
property is updated.
Previously it was using a local copy of renderIt which meant
Vue wouldn't update it when the files renderIt property was updates
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_file.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_file.vue | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index 347a35b9c54..1141a197c6a 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -35,7 +35,6 @@ export default { isLoadingCollapsedDiff: false, forkMessageVisible: false, isCollapsed: this.file.viewer.collapsed || false, - renderIt: this.file.renderIt, }; }, computed: { @@ -53,7 +52,7 @@ export default { ); }, showLoadingIcon() { - return this.isLoadingCollapsedDiff || (!this.renderIt && !this.isCollapsed); + return this.isLoadingCollapsedDiff || (!this.file.renderIt && !this.isCollapsed); }, hasDiffLines() { return ( @@ -80,13 +79,13 @@ export default { eventHub.$on(`loadCollapsedDiff/${this.file.file_hash}`, this.handleLoadCollapsedDiff); }, methods: { - ...mapActions('diffs', ['loadCollapsedDiff', 'assignDiscussionsToDiff']), + ...mapActions('diffs', ['loadCollapsedDiff', 'assignDiscussionsToDiff', 'setRenderIt']), handleToggle() { if (!this.hasDiffLines) { this.handleLoadCollapsedDiff(); } else { this.isCollapsed = !this.isCollapsed; - this.renderIt = true; + this.setRenderIt(this.file); } }, handleLoadCollapsedDiff() { @@ -96,7 +95,7 @@ export default { .then(() => { this.isLoadingCollapsedDiff = false; this.isCollapsed = false; - this.renderIt = true; + this.setRenderIt(this.file); }) .then(() => { requestIdleCallback( |