From 605c66d66bfe52cfc751e82504960f1c77e197e2 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:41:02 +0530 Subject: [PATCH] Show contact support option for incorrect password --- lib/services/user_service.dart | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/services/user_service.dart b/lib/services/user_service.dart index 9b98b48cf..951670d39 100644 --- a/lib/services/user_service.dart +++ b/lib/services/user_service.dart @@ -33,8 +33,10 @@ import "package:photos/ui/account/recovery_page.dart"; import 'package:photos/ui/account/two_factor_authentication_page.dart'; import 'package:photos/ui/account/two_factor_recovery_page.dart'; import 'package:photos/ui/account/two_factor_setup_page.dart'; +import "package:photos/ui/components/buttons/button_widget.dart"; import 'package:photos/utils/crypto_util.dart'; import 'package:photos/utils/dialog_util.dart'; +import "package:photos/utils/email_util.dart"; import 'package:photos/utils/navigation_util.dart'; import 'package:photos/utils/toast_util.dart'; import "package:pointycastle/export.dart"; @@ -641,11 +643,21 @@ class UserService { } on DioError catch (e, s) { await dialog.hide(); if (e.response != null && e.response!.statusCode == 401) { - await showErrorDialog( + final dialogChoice = await showChoiceDialog( context, - S.of(context).incorrectPasswordTitle, - S.of(context).pleaseTryAgain, + title: S.of(context).incorrectPasswordTitle, + body: S.of(context).pleaseTryAgain, + firstButtonLabel: S.of(context).contactSupport, + secondButtonLabel: S.of(context).ok, ); + if (dialogChoice!.action == ButtonAction.first) { + await sendLogs( + context, + S.of(context).contactSupport, + "support@ente.io", + postShare: () {}, + ); + } } else { _logger.fine('failed to verify password', e, s); await showErrorDialog(