Skip to content

Commit

Permalink
🐛 Close mail infos on new password
Browse files Browse the repository at this point in the history
When a new mail account is created close the
mail info screen before showing the success popup.
  • Loading branch information
strifel committed Aug 7, 2022
1 parent 316b9d4 commit 8350afd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/components/mail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ class MailMenu extends StatelessWidget {
void _openMailDialog(BuildContext context) {
API.of(context).requests.getMailSettings().then((mailInfos) {
if (mailInfos.consent) {
print(API.of(context).requests.getUserInfo().mailPasswordConsent);
showCupertinoDialog(context: context,
builder: (context) => CupertinoAlertDialog(
builder: (dialogContext) => CupertinoAlertDialog(
actions: [
CupertinoButton(child: Text("Abbruch"), onPressed: () => Navigator.pop(context)),
Visibility(
Expand All @@ -95,6 +94,7 @@ void _openMailDialog(BuildContext context) {
if (!mailInfos.exists || API.of(context).requests.getUserInfo().mailPasswordConsent) CupertinoButton(
child: Text(mailInfos.exists ? "Neues Passwort" : "Mail erstellen"),
onPressed: () {
Navigator.pop(dialogContext);
if (API.of(context).requests.getUserInfo().mailPasswordConsent) {
API.of(context).requests.resetMailPassword().then((newPassword) => _showNewMailPassword(context, newPassword, mailInfos.exists ? null : mailInfos.primaryMail));
} else { // New account
Expand Down

0 comments on commit 8350afd

Please sign in to comment.