UX: trim mastodon handles when inputted, fix #1791
This commit is contained in:
parent
bed8fb0bf9
commit
e6ec24da80
1 changed files with 2 additions and 0 deletions
|
@ -17,6 +17,7 @@ export default class FediverseValidator extends Validator {
|
||||||
* @param s
|
* @param s
|
||||||
*/
|
*/
|
||||||
reformat(s: string): string {
|
reformat(s: string): string {
|
||||||
|
s = s.trim()
|
||||||
if (!s.startsWith("@")) {
|
if (!s.startsWith("@")) {
|
||||||
s = "@" + s
|
s = "@" + s
|
||||||
}
|
}
|
||||||
|
@ -35,6 +36,7 @@ export default class FediverseValidator extends Validator {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
getFeedback(s: string): Translation | undefined {
|
getFeedback(s: string): Translation | undefined {
|
||||||
|
s = s.trim()
|
||||||
const match = s.match(FediverseValidator.usernameAtServer)
|
const match = s.match(FediverseValidator.usernameAtServer)
|
||||||
console.log("Match:", match)
|
console.log("Match:", match)
|
||||||
if (match) {
|
if (match) {
|
||||||
|
|
Loading…
Reference in a new issue