Skip to content

Commit

Permalink
Improve handling of undefined version label
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Jun 14, 2023
1 parent 6698367 commit ea7e187
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apps/files_versions/src/components/Version.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,21 @@ export default {
* @return {string}
*/
versionLabel() {
const label = this.version.label ?? ''
if (this.isCurrent) {
if (this.version.label === undefined || this.version.label === '') {
if (label === '') {
return translate('files_versions', 'Current version')
} else {
return `${this.version.label} (${translate('files_versions', 'Current version')})`
return `${label} (${translate('files_versions', 'Current version')})`
}
}
if (this.isFirstVersion && this.version.label === '') {
if (this.isFirstVersion && label === '') {
return translate('files_versions', 'Initial version')
}
return this.version.label
return label
},
/**
Expand Down

0 comments on commit ea7e187

Please sign in to comment.