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: { input.onTextChanged: {
const cursorPosition = input.cursorPosition const cursorPosition = input.cursorPosition
input.text = Utils.convertSpacesToDashesAndUpperToLowerCase(input.text) input.text = Utils.convertSpacesToDashes(input.text)
input.cursorPosition = cursorPosition input.cursorPosition = cursorPosition
if (root.channelEmoji === "") { if (root.channelEmoji === "") {
input.letterIconName = text; input.letterIconName = text;

View File

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