fix(auth/support): remove support email and redirect to github discussions

This commit is contained in:
Prateek Sunal 2024-08-02 16:36:05 +05:30
parent 5f7b411b67
commit 986c00f4e8
19 changed files with 67 additions and 66 deletions

View File

@ -36,5 +36,5 @@ file, that adheres to the above format.
SUPPORT SUPPORT
If you need help, please reach out to support@ente.io, and a human will get in touch with you. If you need help, please visit @ https://github.com/ente-io/ente/discussions/new?category=q-a, and someone will get in touch with you.
If you have feature requests, please create an issue @ https://github.com/ente-io/ente If you have feature requests, please create an issue @ https://github.com/ente-io/ente

View File

@ -36,5 +36,5 @@ file, that adheres to the above format.
SUPPORT SUPPORT
If you need help, please reach out to support@ente.io, and a human will get in touch with you. If you need help, please visit @ https://github.com/ente-io/ente/discussions/new?category=q-a, and someone will get in touch with you.
If you have feature requests, please create an issue @ https://github.com/ente-io/ente If you have feature requests, please create an issue @ https://github.com/ente-io/ente

View File

@ -32,8 +32,6 @@ const mnemonicKeyWordCount = 24;
// https://stackoverflow.com/a/61162219 // https://stackoverflow.com/a/61162219
const dragSensitivity = 8; const dragSensitivity = 8;
const supportEmail = 'support@ente.io';
// Default values for various feature flags // Default values for various feature flags
class FFDefault { class FFDefault {
static const bool enableStripe = true; static const bool enableStripe = true;

View File

@ -465,5 +465,6 @@
"appLockDescription": "Choose between your device's default lock screen and a custom lock screen with a PIN or password.", "appLockDescription": "Choose between your device's default lock screen and a custom lock screen with a PIN or password.",
"pinLock": "Pin lock", "pinLock": "Pin lock",
"enterPin": "Enter PIN", "enterPin": "Enter PIN",
"setNewPin": "Set new PIN" "setNewPin": "Set new PIN",
"importFailureDescNew": "Could not parse the selected file."
} }

View File

@ -182,7 +182,6 @@ class _LoginPasswordVerificationPageState
await sendLogs( await sendLogs(
context, context,
context.l10n.contactSupport, context.l10n.contactSupport,
"auth@ente.io",
postShare: () {}, postShare: () {},
); );
} }

View File

@ -140,7 +140,6 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
await sendLogs( await sendLogs(
context, context,
context.l10n.contactSupport, context.l10n.contactSupport,
"support@ente.io",
postShare: () {}, postShare: () {},
); );
} }

View File

@ -5,7 +5,7 @@ import 'package:ente_auth/theme/ente_theme.dart';
import 'package:ente_auth/ui/common/gradient_button.dart'; import 'package:ente_auth/ui/common/gradient_button.dart';
import 'package:ente_auth/ui/linear_progress_widget.dart'; import 'package:ente_auth/ui/linear_progress_widget.dart';
import 'package:ente_auth/ui/tools/debug/raw_codes_viewer.dart'; import 'package:ente_auth/ui/tools/debug/raw_codes_viewer.dart';
import 'package:ente_auth/utils/dialog_util.dart'; import 'package:ente_auth/utils/email_util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CodeErrorWidget extends StatelessWidget { class CodeErrorWidget extends StatelessWidget {
@ -114,12 +114,7 @@ class CodeErrorWidget extends StatelessWidget {
text: context.l10n.contactSupport, text: context.l10n.contactSupport,
fontSize: 10, fontSize: 10,
onTap: () async { onTap: () async {
await showErrorDialog( await openSupportPage(null, null);
context,
context.l10n.contactSupport,
context.l10n
.contactSupportViaEmailMessage("support@ente.io"),
);
}, },
borderWidth: 0.6, borderWidth: 0.6,
borderRadius: 6, borderRadius: 6,

View File

@ -22,7 +22,6 @@ PopupMenuButton<dynamic> reportBugPopupMenu(BuildContext context) {
await sendLogs( await sendLogs(
context, context,
"Contact support", "Contact support",
"support@ente.io",
postShare: () {}, postShare: () {},
); );
} }

View File

@ -77,7 +77,7 @@ Future<void> _pickAegisJsonFile(BuildContext context) async {
await showErrorDialog( await showErrorDialog(
context, context,
context.l10n.sorry, context.l10n.sorry,
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}", "${context.l10n.importFailureDescNew}\n Error: ${e.toString()}",
); );
} }
} }

View File

@ -68,7 +68,7 @@ Future<void> _pickBitwardenJsonFile(BuildContext context) async {
await showErrorDialog( await showErrorDialog(
context, context,
context.l10n.sorry, context.l10n.sorry,
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}", "${context.l10n.importFailureDescNew}\n Error: ${e.toString()}",
); );
} }
} }

View File

@ -150,7 +150,7 @@ Future<void> _pickEnteJsonFile(BuildContext context) async {
await showErrorDialog( await showErrorDialog(
context, context,
context.l10n.sorry, context.l10n.sorry,
context.l10n.importFailureDesc, context.l10n.importFailureDescNew,
); );
} }
} }

View File

@ -67,7 +67,7 @@ Future<void> _pickLastpassJsonFile(BuildContext context) async {
await showErrorDialog( await showErrorDialog(
context, context,
context.l10n.sorry, context.l10n.sorry,
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}", "${context.l10n.importFailureDescNew}\n Error: ${e.toString()}",
); );
} }
} }

View File

@ -144,7 +144,7 @@ Future<void> _pickImportFile(BuildContext context) async {
await showErrorDialog( await showErrorDialog(
context, context,
context.l10n.sorry, context.l10n.sorry,
context.l10n.importFailureDesc, context.l10n.importFailureDescNew,
); );
} }
} }

View File

@ -67,7 +67,7 @@ Future<void> _pickRaivoJsonFile(BuildContext context) async {
await showErrorDialog( await showErrorDialog(
context, context,
context.l10n.sorry, context.l10n.sorry,
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}", "${context.l10n.importFailureDescNew}\n Error: ${e.toString()}",
); );
} }
} }

View File

@ -72,7 +72,7 @@ Future<void> _pick2FasFile(BuildContext context) async {
await showErrorDialog( await showErrorDialog(
context, context,
context.l10n.sorry, context.l10n.sorry,
"${context.l10n.importFailureDesc}\n Error: ${e.toString()}", "${context.l10n.importFailureDescNew}\n Error: ${e.toString()}",
); );
} }
} }

View File

@ -70,18 +70,18 @@ class _SupportSectionWidgetState extends State<SupportSectionWidget> {
}, },
), ),
sectionOptionSpacing, sectionOptionSpacing,
MenuItemWidget( // MenuItemWidget(
captionedTextWidget: CaptionedTextWidget( // captionedTextWidget: CaptionedTextWidget(
title: l10n.email, // title: l10n.email,
), // ),
pressedColor: getEnteColorScheme(context).fillFaint, // pressedColor: getEnteColorScheme(context).fillFaint,
trailingIcon: Icons.chevron_right_outlined, // trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true, // trailingIconIsMuted: true,
onTap: () async { // onTap: () async {
await sendEmail(context, to: supportEmail); // await sendEmail(context, to: supportEmail);
}, // },
), // ),
sectionOptionSpacing, // sectionOptionSpacing,
MenuItemWidget( MenuItemWidget(
captionedTextWidget: CaptionedTextWidget( captionedTextWidget: CaptionedTextWidget(
title: l10n.reportABug, title: l10n.reportABug,
@ -90,7 +90,7 @@ class _SupportSectionWidgetState extends State<SupportSectionWidget> {
trailingIcon: Icons.chevron_right_outlined, trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true, trailingIconIsMuted: true,
onTap: () async { onTap: () async {
await sendLogs(context, l10n.reportBug, "auth@ente.io"); await sendLogs(context, l10n.reportBug);
}, },
onDoubleTap: () async { onDoubleTap: () async {
try { try {

View File

@ -1,7 +1,7 @@
import 'package:ente_auth/l10n/l10n.dart'; import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/account/two_factor.dart'; import 'package:ente_auth/models/account/two_factor.dart';
import 'package:ente_auth/services/user_service.dart'; import 'package:ente_auth/services/user_service.dart';
import 'package:ente_auth/utils/dialog_util.dart'; import 'package:ente_auth/utils/email_util.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TwoFactorRecoveryPage extends StatefulWidget { class TwoFactorRecoveryPage extends StatefulWidget {
@ -86,12 +86,8 @@ class _TwoFactorRecoveryPageState extends State<TwoFactorRecoveryPage> {
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () async {
showErrorDialog( await openSupportPage(null, null);
context,
l10n.contactSupport,
l10n.contactSupportViaEmailMessage("support@ente.io"),
);
}, },
child: Container( child: Container(
padding: const EdgeInsets.all(40), padding: const EdgeInsets.all(40),

View File

@ -31,12 +31,21 @@ Future<ButtonResult?> showErrorDialog(
title: title, title: title,
body: body, body: body,
isDismissible: isDismissable, isDismissible: isDismissable,
buttons: const [ buttons: [
ButtonWidget( ButtonWidget(
buttonType: ButtonType.primary,
labelText: context.l10n.contactSupport,
isInAlert: true,
buttonAction: ButtonAction.first,
onTap: () async {
await openSupportPage(body, null);
},
),
const ButtonWidget(
buttonType: ButtonType.secondary, buttonType: ButtonType.secondary,
labelText: "OK", labelText: "OK",
isInAlert: true, isInAlert: true,
buttonAction: ButtonAction.first, buttonAction: ButtonAction.second,
), ),
], ],
); );
@ -158,7 +167,6 @@ Future<ButtonResult?> showGenericErrorDialog({
await sendLogs( await sendLogs(
context, context,
context.l10n.contactSupport, context.l10n.contactSupport,
"support@ente.io",
postShare: () {}, postShare: () {},
); );
}, },

View File

@ -16,7 +16,6 @@ import 'package:ente_auth/utils/toast_util.dart';
import "package:file_saver/file_saver.dart"; import "package:file_saver/file_saver.dart";
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_email_sender/flutter_email_sender.dart';
import "package:intl/intl.dart"; import "package:intl/intl.dart";
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
@ -35,8 +34,7 @@ bool isValidEmail(String? email) {
Future<void> sendLogs( Future<void> sendLogs(
BuildContext context, BuildContext context,
String title, String title, {
String toEmail, {
Function? postShare, Function? postShare,
String? subject, String? subject,
String? body, String? body,
@ -55,7 +53,7 @@ Future<void> sendLogs(
buttonAction: ButtonAction.first, buttonAction: ButtonAction.first,
shouldSurfaceExecutionStates: false, shouldSurfaceExecutionStates: false,
onTap: () async { onTap: () async {
await _sendLogs(context, toEmail, subject, body); await openSupportPage(subject, body);
if (postShare != null) { if (postShare != null) {
postShare(); postShare();
} }
@ -111,27 +109,35 @@ Future<void> sendLogs(
); );
} }
Future<void> _sendLogs( Future<void> openSupportPage(
BuildContext context,
String toEmail,
String? subject, String? subject,
String? body, String? body,
) async { ) async {
final String zipFilePath = await getZippedLogsFile(context); const url = "https://github.com/ente-io/ente/discussions/new?category=q-a";
final Email email = Email( if (subject != null && body != null) {
recipients: [toEmail], await launchUrl(
subject: subject ?? '', Uri.parse(
body: body ?? '', "$url&title=$subject&body=$body",
attachmentPaths: [zipFilePath], ),
isHTML: false, );
); } else {
try { await launchUrl(Uri.parse(url));
await FlutterEmailSender.send(email);
} catch (e, s) {
_logger.severe('email sender failed', e, s);
Navigator.of(context, rootNavigator: true).pop();
await shareLogs(context, toEmail, zipFilePath);
} }
// final String zipFilePath = await getZippedLogsFile(context);
// final Email email = Email(
// recipients: [toEmail],
// subject: subject ?? '',
// body: body ?? '',
// attachmentPaths: [zipFilePath],
// isHTML: false,
// );
// try {
// await FlutterEmailSender.send(email);
// } catch (e, s) {
// _logger.severe('email sender failed', e, s);
// Navigator.of(context, rootNavigator: true).pop();
// await shareLogs(context, toEmail, zipFilePath);
// }
} }
Future<String> getZippedLogsFile(BuildContext context) async { Future<String> getZippedLogsFile(BuildContext context) async {