mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-02 16:14:21 +01:00
Merge branch 'krille/minor-sign-up-fixes' into 'main'
chore: Make error text on email orange and set displayname See merge request famedly/fluffychat!898
This commit is contained in:
commit
fbdc739991
@ -20,6 +20,7 @@ abstract class FluffyThemes {
|
|||||||
String? hintText,
|
String? hintText,
|
||||||
Widget? suffixIcon,
|
Widget? suffixIcon,
|
||||||
Widget? prefixIcon,
|
Widget? prefixIcon,
|
||||||
|
Color? errorColor,
|
||||||
}) =>
|
}) =>
|
||||||
InputDecoration(
|
InputDecoration(
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
@ -36,12 +37,12 @@ abstract class FluffyThemes {
|
|||||||
errorText: errorText,
|
errorText: errorText,
|
||||||
errorMaxLines: 4,
|
errorMaxLines: 4,
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
color: Colors.red.shade200,
|
color: errorColor ?? Colors.redAccent.shade200,
|
||||||
shadows: const [
|
shadows: const [
|
||||||
Shadow(
|
Shadow(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
offset: Offset(0, 0),
|
offset: Offset(0, 0),
|
||||||
blurRadius: 5,
|
blurRadius: 10,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -97,14 +97,24 @@ class SignupPageController extends State<SignupPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final displayname = Matrix.of(context).loginUsername!;
|
||||||
|
final localPart = displayname.toLowerCase().replaceAll(' ', '_');
|
||||||
|
|
||||||
await client.uiaRequestBackground(
|
await client.uiaRequestBackground(
|
||||||
(auth) => client.register(
|
(auth) => client.register(
|
||||||
username: Matrix.of(context).loginUsername!,
|
username: localPart,
|
||||||
password: passwordController.text,
|
password: passwordController.text,
|
||||||
initialDeviceDisplayName: PlatformInfos.clientName,
|
initialDeviceDisplayName: PlatformInfos.clientName,
|
||||||
auth: auth,
|
auth: auth,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
// Set displayname
|
||||||
|
if (displayname != localPart) {
|
||||||
|
await client.setDisplayName(
|
||||||
|
client.userID!,
|
||||||
|
displayname,
|
||||||
|
);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = (e).toLocalizedString(context);
|
error = (e).toLocalizedString(context);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -94,6 +94,9 @@ class SignupPageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
hintText: L10n.of(context)!.enterAnEmailAddress,
|
hintText: L10n.of(context)!.enterAnEmailAddress,
|
||||||
errorText: controller.error,
|
errorText: controller.error,
|
||||||
|
errorColor: controller.emailController.text.isEmpty
|
||||||
|
? Colors.orangeAccent
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user