UX: trim mastodon handles when inputted, fix #1791

This commit is contained in:
Pieter Vander Vennet 2024-02-20 12:28:01 +01:00
parent bed8fb0bf9
commit e6ec24da80

View file

@ -17,6 +17,7 @@ export default class FediverseValidator extends Validator {
* @param s
*/
reformat(s: string): string {
s = s.trim()
if (!s.startsWith("@")) {
s = "@" + s
}
@ -35,6 +36,7 @@ export default class FediverseValidator extends Validator {
return undefined
}
getFeedback(s: string): Translation | undefined {
s = s.trim()
const match = s.match(FediverseValidator.usernameAtServer)
console.log("Match:", match)
if (match) {