fix(@desktop/channels): allow capitals in channel name

This commit is contained in:
mprakhov 2023-03-07 12:33:28 +01:00 committed by Mykhailo Prakhov
parent 601d3dd0f1
commit cb924053c6
2 changed files with 3 additions and 9 deletions

View File

@ -108,7 +108,7 @@ StatusDialog {
input.onTextChanged: {
const cursorPosition = input.cursorPosition
input.text = Utils.convertSpacesToDashesAndUpperToLowerCase(input.text)
input.text = Utils.convertSpacesToDashes(input.text)
input.cursorPosition = cursorPosition
if (root.channelEmoji === "") {
input.letterIconName = text;

View File

@ -332,15 +332,9 @@ QtObject {
return (/[A-Z]/.test(str))
}
function convertSpacesToDashesAndUpperToLowerCase(str)
function convertSpacesToDashes(str)
{
if (str.includes(" "))
str = str.replace(/ /g, "-")
if(hasUpperCaseLetter(str))
str = str.toLowerCase()
return str
return str.replace(/ /g, "-")
}
/* Validation section start */