aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-05-25 15:37:22 +0200
committerLouis Chemineau <louis@chmn.me>2023-05-25 23:46:04 +0200
commitc40de8b88f57208485fdf2e7df2855a95110b6af (patch)
treeb9bb0fa481777db122eafde691e52f6b6bb6f282 /apps/files_versions
parentcc525094b2ef53fc43bc2ee4672d4061b4d9cb0d (diff)
downloadnextcloud-server-c40de8b88f57208485fdf2e7df2855a95110b6af.tar.gz
nextcloud-server-c40de8b88f57208485fdf2e7df2855a95110b6af.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.vue10
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 a368720bb51..8da50718cd3 100644
--- a/apps/files_versions/src/components/Version.vue
+++ b/apps/files_versions/src/components/Version.vue
@@ -190,19 +190,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
},
/**