Settings
This commit is contained in:
parent
dfcb8b6224
commit
241001d51b
|
|
@ -83,6 +83,14 @@ class RecoverPasswordRequest implements StartLoading {
|
||||||
final String secret;
|
final String secret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class RecoverPasswordSuccess implements StopLoading {}
|
||||||
|
|
||||||
|
class RecoverPasswordFailure implements StopLoading {
|
||||||
|
RecoverPasswordFailure(this.error);
|
||||||
|
|
||||||
|
final Object error;
|
||||||
|
}
|
||||||
|
|
||||||
class UserLogout implements PersistData, PersistUI {
|
class UserLogout implements PersistData, PersistUI {
|
||||||
UserLogout(this.context);
|
UserLogout(this.context);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,9 +217,11 @@ Middleware<AppState> _createRecoverRequest(AuthRepository repository) {
|
||||||
secret: action.secret,
|
secret: action.secret,
|
||||||
)
|
)
|
||||||
.then((data) {
|
.then((data) {
|
||||||
|
store.dispatch(RecoverPasswordSuccess());
|
||||||
action.completer.complete(null);
|
action.completer.complete(null);
|
||||||
}).catchError((Object error) {
|
}).catchError((Object error) {
|
||||||
if (action.completer != null) {
|
if (action.completer != null) {
|
||||||
|
store.dispatch(RecoverPasswordFailure(error.toString()));
|
||||||
action.completer.completeError(error);
|
action.completer.completeError(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:invoiceninja_flutter/constants.dart';
|
import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/ui/ui_state.dart';
|
import 'package:invoiceninja_flutter/redux/ui/ui_state.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/buttons/elevated_button.dart';
|
import 'package:invoiceninja_flutter/ui/app/buttons/elevated_button.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/dialogs/alert_dialog.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/link_text.dart';
|
import 'package:invoiceninja_flutter/ui/app/link_text.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
||||||
|
|
@ -168,6 +169,15 @@ class _LoginState extends State<LoginView> {
|
||||||
completer.future.then((_) {
|
completer.future.then((_) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_loginError = '';
|
_loginError = '';
|
||||||
|
if (_recovePassword) {
|
||||||
|
_recovePassword = false;
|
||||||
|
showDialog<MessageDialog>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return MessageDialog(
|
||||||
|
AppLocalization.of(context).recoverPasswordEmailSent);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}).catchError((Object error) {
|
}).catchError((Object error) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ abstract class LocaleCodeAware {
|
||||||
mixin LocalizationsProvider on LocaleCodeAware {
|
mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
|
'recover_password_email_sent': 'A password recovery email has been sent',
|
||||||
'submit': 'Submit',
|
'submit': 'Submit',
|
||||||
'recover_password': 'Recover Password',
|
'recover_password': 'Recover Password',
|
||||||
'late_fees': 'Late Fees',
|
'late_fees': 'Late Fees',
|
||||||
|
|
@ -15452,10 +15453,14 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
|
|
||||||
String get lateFees => _localizedValues[localeCode]['late_fees'];
|
String get lateFees => _localizedValues[localeCode]['late_fees'];
|
||||||
|
|
||||||
String get recoverPassword => _localizedValues[localeCode]['recover_password'];
|
String get recoverPassword =>
|
||||||
|
_localizedValues[localeCode]['recover_password'];
|
||||||
|
|
||||||
String get submit => _localizedValues[localeCode]['submit'];
|
String get submit => _localizedValues[localeCode]['submit'];
|
||||||
|
|
||||||
|
String get recoverPasswordEmailSent =>
|
||||||
|
_localizedValues[localeCode]['recover_password_email_sent'];
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
return _localizedValues[localeCode][lookupKey] ??
|
return _localizedValues[localeCode][lookupKey] ??
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue