diff options
author | Louis Chemineau <louis@chmn.me> | 2023-05-25 15:37:22 +0200 |
---|---|---|
committer | Louis <6653109+artonge@users.noreply.github.com> | 2023-06-14 09:56:23 +0200 |
commit | ea7e18716a470d7b723fcfb7cd0b2416a839cd1a (patch) | |
tree | 41d601c97ccdfa26f0da3fe718e181ce1c340e61 /apps/files_versions | |
parent | 669836790e59df7e71cbc1b401340972573a0815 (diff) | |
download | nextcloud-server-ea7e18716a470d7b723fcfb7cd0b2416a839cd1a.tar.gz nextcloud-server-ea7e18716a470d7b723fcfb7cd0b2416a839cd1a.zip |
Improve handling of undefined version label
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/src/components/Version.vue | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_versions/src/components/Version.vue b/apps/files_versions/src/components/Version.vue index 51ef3ef61a0..b5c4cbf2c4c 100644 --- a/apps/files_versions/src/components/Version.vue +++ b/apps/files_versions/src/components/Version.vue @@ -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 }, /** |