fix: Password success banner if not succeeded

onboarding
Christian Pauly 5 years ago
parent f032c0900e
commit 092f4af893

@ -82,16 +82,18 @@ class _SettingsState extends State<Settings> {
], ],
); );
if (input == null) return; if (input == null) return;
await showFutureLoadingDialog( final success = await showFutureLoadingDialog(
context: context, context: context,
future: () => Matrix.of(context) future: () => Matrix.of(context)
.client .client
.changePassword(input.last, oldPassword: input.first), .changePassword(input.last, oldPassword: input.first),
); );
if (success.error == null) {
await FlushbarHelper.createSuccess( await FlushbarHelper.createSuccess(
message: L10n.of(context).passwordHasBeenChanged) message: L10n.of(context).passwordHasBeenChanged)
.show(context); .show(context);
} }
}
void _deleteAccountAction(BuildContext context) async { void _deleteAccountAction(BuildContext context) async {
if (await showOkCancelAlertDialog( if (await showOkCancelAlertDialog(

Loading…
Cancel
Save