From 6b5de58dde50653e736f2145b414bfa6da63ece9 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Sat, 5 Mar 2022 11:49:14 +0100 Subject: [PATCH] output shortest URL link in editor when multiple are available --- zero.Backoffice.UI/app/components/ui-form-header-links.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zero.Backoffice.UI/app/components/ui-form-header-links.vue b/zero.Backoffice.UI/app/components/ui-form-header-links.vue index d85bfac9..988d3be3 100644 --- a/zero.Backoffice.UI/app/components/ui-form-header-links.vue +++ b/zero.Backoffice.UI/app/components/ui-form-header-links.vue @@ -8,7 +8,8 @@ - {{urlLink}} + + {{urlList.length}} URLs @@ -84,11 +85,11 @@ }, urlLink() { - return this.urlDomain && this.urlList.length ? this.urlList[0] : null; + return this.urlDomain && this.urlList.length ? this.urlList.reduce((a, b) => a.length <= b.length ? a : b) : null; }, urlLinkAbsolute() { - return this.urlDomain && this.urlList.length ? this.urlDomain + this.urlList[0] : null; + return this.urlDomain && this.urlList.length ? this.urlDomain + this.urlList.reduce((a, b) => a.length <= b.length ? a : b) : null; }, previewLink() {