chore: Make error text on email orange and set displayname
This commit is contained in:
parent
c518c9c344
commit
e5c29eedfe
3 changed files with 17 additions and 3 deletions
|
|
@ -97,14 +97,24 @@ class SignupPageController extends State<SignupPage> {
|
|||
);
|
||||
}
|
||||
|
||||
final displayname = Matrix.of(context).loginUsername!;
|
||||
final localPart = displayname.toLowerCase().replaceAll(' ', '_');
|
||||
|
||||
await client.uiaRequestBackground(
|
||||
(auth) => client.register(
|
||||
username: Matrix.of(context).loginUsername!,
|
||||
username: localPart,
|
||||
password: passwordController.text,
|
||||
initialDeviceDisplayName: PlatformInfos.clientName,
|
||||
auth: auth,
|
||||
),
|
||||
);
|
||||
// Set displayname
|
||||
if (displayname != localPart) {
|
||||
await client.setDisplayName(
|
||||
client.userID!,
|
||||
displayname,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
error = (e).toLocalizedString(context);
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ class SignupPageView extends StatelessWidget {
|
|||
),
|
||||
hintText: L10n.of(context)!.enterAnEmailAddress,
|
||||
errorText: controller.error,
|
||||
errorColor: controller.emailController.text.isEmpty
|
||||
? Colors.orangeAccent
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue