From b3afe9fb16523415f3bceafde9bb80b4d229e2b2 Mon Sep 17 00:00:00 2001 From: fengpan Date: Fri, 17 Feb 2017 21:58:39 +0800 Subject: Rename channel (#5322) * fix react proptypes * Replace the handle field and label with url * Update rename channel url correctly * fix merge * fix after test-1 * update i18n --- webapp/utils/url.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'webapp/utils/url.jsx') diff --git a/webapp/utils/url.jsx b/webapp/utils/url.jsx index 9fe00da6f..6307814f2 100644 --- a/webapp/utils/url.jsx +++ b/webapp/utils/url.jsx @@ -9,11 +9,12 @@ export function cleanUpUrlable(input) { return cleaned; } -export function getShortenedTeamURL(teamURL = '') { - if (teamURL.length > 35) { - return teamURL.substring(0, 10) + '...' + teamURL.substring(teamURL.length - 12, teamURL.length) + '/'; +export function getShortenedURL(url = '', getLength = 27) { + if (url.length > 35) { + const subLength = getLength - 14; + return url.substring(0, 10) + '...' + url.substring(url.length - subLength, url.length) + '/'; } - return teamURL + '/'; + return url + '/'; } export function getSiteURL() { -- cgit v1.2.3-1-g7c22