From 51505631b5fd85ccd8c27dff97859e7eb3462763 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 25 Feb 2021 07:58:38 +0100 Subject: [PATCH] fix: Password success banner if not succeeded --- lib/views/settings.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/views/settings.dart b/lib/views/settings.dart index 86980e92..fcfbd3ab 100644 --- a/lib/views/settings.dart +++ b/lib/views/settings.dart @@ -82,15 +82,17 @@ class _SettingsState extends State { ], ); if (input == null) return; - await showFutureLoadingDialog( + final success = await showFutureLoadingDialog( context: context, future: () => Matrix.of(context) .client .changePassword(input.last, oldPassword: input.first), ); - await FlushbarHelper.createSuccess( - message: L10n.of(context).passwordHasBeenChanged) - .show(context); + if (success.error == null) { + await FlushbarHelper.createSuccess( + message: L10n.of(context).passwordHasBeenChanged) + .show(context); + } } void _deleteAccountAction(BuildContext context) async {