diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-31 15:08:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-31 15:08:33 +0300 |
commit | 1808454313ed75c92e1384466e8c83bfbc8ae25e (patch) | |
tree | 5c006c158fd796dc6d21e9bd771542f2fb0c24e2 /app/assets/javascripts/diffs/components | |
parent | fd3a95f07ae9cd78fecffcfa5de4494f933a7808 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs/components')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_stats.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_stats.vue b/app/assets/javascripts/diffs/components/diff_stats.vue index 2e5855380af..5329cb1e241 100644 --- a/app/assets/javascripts/diffs/components/diff_stats.vue +++ b/app/assets/javascripts/diffs/components/diff_stats.vue @@ -1,6 +1,7 @@ <script> import Icon from '~/vue_shared/components/icon.vue'; import { n__ } from '~/locale'; +import { isNumber } from 'underscore'; export default { components: { Icon }, @@ -16,7 +17,7 @@ export default { diffFilesLength: { type: Number, required: false, - default: null, + default: 0, }, }, computed: { @@ -26,6 +27,9 @@ export default { isCompareVersionsHeader() { return Boolean(this.diffFilesLength); }, + hasDiffFiles() { + return isNumber(this.diffFilesLength) && this.diffFilesLength >= 0; + }, }, }; </script> @@ -38,7 +42,7 @@ export default { 'd-inline-flex': !isCompareVersionsHeader, }" > - <div v-if="diffFilesLength !== null" class="diff-stats-group"> + <div v-if="hasDiffFiles" class="diff-stats-group"> <icon name="doc-code" class="diff-stats-icon text-secondary" /> <strong>{{ diffFilesLength }} {{ filesText }}</strong> </div> |