mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 14:28:40 +00:00
commit
333f033993
11 changed files with 42 additions and 8 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
"registerUsernameSlogan": "Bitte wähle einen Benutzernamen, damit dich andere finden können!",
|
"registerUsernameSlogan": "Bitte wähle einen Benutzernamen, damit dich andere finden können!",
|
||||||
"registerUsernameDecoration": "Benutzername",
|
"registerUsernameDecoration": "Benutzername",
|
||||||
"registerUsernameLimits": "Der Benutzername muss mindestens 3 Zeichen lang sein.",
|
"registerUsernameLimits": "Der Benutzername muss mindestens 3 Zeichen lang sein.",
|
||||||
|
"registerProofOfWorkFailed": "Beim Captcha-Test gab es ein Problem. Bitte versuche es erneut.",
|
||||||
"registerSubmitButton": "Jetzt registrieren!",
|
"registerSubmitButton": "Jetzt registrieren!",
|
||||||
"registerTwonlyCodeText": "Hast du einen twonly-Code erhalten? Dann löse ihn entweder direkt hier oder später ein!",
|
"registerTwonlyCodeText": "Hast du einen twonly-Code erhalten? Dann löse ihn entweder direkt hier oder später ein!",
|
||||||
"registerTwonlyCodeLabel": "twonly-Code",
|
"registerTwonlyCodeLabel": "twonly-Code",
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
"registerUsernameSlogan": "Please select a username so others can find you!",
|
"registerUsernameSlogan": "Please select a username so others can find you!",
|
||||||
"registerUsernameDecoration": "Username",
|
"registerUsernameDecoration": "Username",
|
||||||
"registerUsernameLimits": "Your username must be at least 3 characters long.",
|
"registerUsernameLimits": "Your username must be at least 3 characters long.",
|
||||||
|
"registerProofOfWorkFailed": "There was an issue with the captcha test. Please try again.",
|
||||||
"registerSubmitButton": "Register now!",
|
"registerSubmitButton": "Register now!",
|
||||||
"registerTwonlyCodeText": "Have you received a twonly code? Then redeem it either directly here or later!",
|
"registerTwonlyCodeText": "Have you received a twonly code? Then redeem it either directly here or later!",
|
||||||
"registerTwonlyCodeLabel": "twonly-Code",
|
"registerTwonlyCodeLabel": "twonly-Code",
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,12 @@ abstract class AppLocalizations {
|
||||||
/// **'Your username must be at least 3 characters long.'**
|
/// **'Your username must be at least 3 characters long.'**
|
||||||
String get registerUsernameLimits;
|
String get registerUsernameLimits;
|
||||||
|
|
||||||
|
/// No description provided for @registerProofOfWorkFailed.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'There was an issue with the captcha test. Please try again.'**
|
||||||
|
String get registerProofOfWorkFailed;
|
||||||
|
|
||||||
/// No description provided for @registerSubmitButton.
|
/// No description provided for @registerSubmitButton.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,10 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||||
String get registerUsernameLimits =>
|
String get registerUsernameLimits =>
|
||||||
'Der Benutzername muss mindestens 3 Zeichen lang sein.';
|
'Der Benutzername muss mindestens 3 Zeichen lang sein.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get registerProofOfWorkFailed =>
|
||||||
|
'Beim Captcha-Test gab es ein Problem. Bitte versuche es erneut.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get registerSubmitButton => 'Jetzt registrieren!';
|
String get registerSubmitButton => 'Jetzt registrieren!';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,10 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||||
String get registerUsernameLimits =>
|
String get registerUsernameLimits =>
|
||||||
'Your username must be at least 3 characters long.';
|
'Your username must be at least 3 characters long.';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get registerProofOfWorkFailed =>
|
||||||
|
'There was an issue with the captcha test. Please try again.';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get registerSubmitButton => 'Register now!';
|
String get registerSubmitButton => 'Register now!';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,8 @@ class PurchasesProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
||||||
for (var i = 0; i < 100; i++) {
|
for (var i = 0; i < 100; i++) {
|
||||||
if (apiService.isAuthenticated) {
|
if (apiService.isAuthenticated) {
|
||||||
Log.info(
|
Log.info(
|
||||||
'current user does not have a sub: ${purchaseDetails.productID}');
|
'current user does not have a sub: ${purchaseDetails.productID}',
|
||||||
|
);
|
||||||
await _verifyPurchase(purchaseDetails);
|
await _verifyPurchase(purchaseDetails);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -364,5 +364,6 @@ String getAvatarSvg(Uint8List avatarSvgCompressed) {
|
||||||
|
|
||||||
void printWrapped(String text) {
|
void printWrapped(String text) {
|
||||||
final pattern = RegExp('.{1,800}'); // 800 is the size of each chunk
|
final pattern = RegExp('.{1,800}'); // 800 is the size of each chunk
|
||||||
|
// ignore: avoid_print
|
||||||
pattern.allMatches(text).forEach((match) => print(match.group(0)));
|
pattern.allMatches(text).forEach((match) => print(match.group(0)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ class _SearchUsernameView extends State<AddNewUserView> {
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(12),
|
LengthLimitingTextInputFormatter(12),
|
||||||
FilteringTextInputFormatter.allow(RegExp('[a-z0-9A-Z]')),
|
FilteringTextInputFormatter.allow(RegExp('[a-z0-9A-Z._]')),
|
||||||
],
|
],
|
||||||
controller: searchUserName,
|
controller: searchUserName,
|
||||||
decoration:
|
decoration:
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ class _RegisterViewState extends State<RegisterView> {
|
||||||
bool _isTryingToRegister = false;
|
bool _isTryingToRegister = false;
|
||||||
bool _isValidUserName = false;
|
bool _isValidUserName = false;
|
||||||
bool _showUserNameError = false;
|
bool _showUserNameError = false;
|
||||||
|
bool _showProofOfWorkError = false;
|
||||||
|
|
||||||
late Future<int>? proofOfWork;
|
late Future<int>? proofOfWork;
|
||||||
|
|
||||||
|
|
@ -63,6 +64,7 @@ class _RegisterViewState extends State<RegisterView> {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isTryingToRegister = true;
|
_isTryingToRegister = true;
|
||||||
_showUserNameError = false;
|
_showUserNameError = false;
|
||||||
|
_showProofOfWorkError = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
late int proof;
|
late int proof;
|
||||||
|
|
@ -93,6 +95,7 @@ class _RegisterViewState extends State<RegisterView> {
|
||||||
Log.info('Got user_id ${res.value} from server');
|
Log.info('Got user_id ${res.value} from server');
|
||||||
userId = res.value.userid.toInt() as int;
|
userId = res.value.userid.toInt() as int;
|
||||||
} else {
|
} else {
|
||||||
|
proofOfWork = null;
|
||||||
if (res.error == ErrorCode.RegistrationDisabled) {
|
if (res.error == ErrorCode.RegistrationDisabled) {
|
||||||
_registrationDisabled = true;
|
_registrationDisabled = true;
|
||||||
return;
|
return;
|
||||||
|
|
@ -103,9 +106,12 @@ class _RegisterViewState extends State<RegisterView> {
|
||||||
return createNewUser();
|
return createNewUser();
|
||||||
}
|
}
|
||||||
if (res.error == ErrorCode.InvalidProofOfWork) {
|
if (res.error == ErrorCode.InvalidProofOfWork) {
|
||||||
Log.error('Proof of Work is invalid. Try again.');
|
|
||||||
await deleteLocalUserData();
|
await deleteLocalUserData();
|
||||||
return createNewUser();
|
setState(() {
|
||||||
|
_showProofOfWorkError = true;
|
||||||
|
_isTryingToRegister = false;
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -232,7 +238,7 @@ class _RegisterViewState extends State<RegisterView> {
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(12),
|
LengthLimitingTextInputFormatter(12),
|
||||||
FilteringTextInputFormatter.allow(RegExp('[a-z0-9A-Z]')),
|
FilteringTextInputFormatter.allow(RegExp('[a-z0-9A-Z._]')),
|
||||||
],
|
],
|
||||||
style: const TextStyle(fontSize: 17),
|
style: const TextStyle(fontSize: 17),
|
||||||
decoration: getInputDecoration(
|
decoration: getInputDecoration(
|
||||||
|
|
@ -248,7 +254,17 @@ class _RegisterViewState extends State<RegisterView> {
|
||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 10),
|
||||||
|
Text(
|
||||||
|
context.lang.registerProofOfWorkFailed,
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
_showProofOfWorkError ? Colors.red : Colors.transparent,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
FilledButton.icon(
|
FilledButton.icon(
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ class _ProfileViewState extends State<ProfileView> {
|
||||||
maxLength: 12,
|
maxLength: 12,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(12),
|
LengthLimitingTextInputFormatter(12),
|
||||||
FilteringTextInputFormatter.allow(RegExp('[a-z0-9A-Z]')),
|
FilteringTextInputFormatter.allow(RegExp('[a-z0-9A-Z._]')),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
if (context.mounted && username != null && username != '') {
|
if (context.mounted && username != null && username != '') {
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class _SettingsMainViewState extends State<SettingsMainView> {
|
||||||
},
|
},
|
||||||
icon: const FaIcon(FontAwesomeIcons.qrcode),
|
icon: const FaIcon(FontAwesomeIcons.qrcode),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue