Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class AuthenticationService {
static StreamController<bool> isLoggedInStream =
StreamController<bool>.broadcast();

static const String supportEmail = 'mobile@freecodecamp.org';

StreamController<bool> progress = StreamController.broadcast();

final Stream<bool> _isLoggedIn = isLoggedInStream.stream;
Expand Down Expand Up @@ -214,12 +216,11 @@ class AuthenticationService {
await writeTokensToStorage();
await fetchUser();
} on DioException catch (err, st) {
String supportEmail = Uri.encodeComponent('mobile@feeecodecamp.org');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this explains why we don’t get complaint emails?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in it's encoded or the wrong email?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong email

String subject = Uri.encodeComponent('Error logging in to mobile app');
Navigator.pop(context);
if (err.response != null) {
String body = Uri.encodeComponent(
'Please email the below error to mobile@freecodecamp.org\n\n${err.response!.data.toString()}\n\n${st.toString()}');
'Please email the below error to ${AuthenticationService.supportEmail}\n\n${err.response!.data.toString()}\n\n${st.toString()}');
await showDialog(
context: context,
barrierDismissible: false,
Expand All @@ -235,7 +236,7 @@ class AuthenticationService {
content: SingleChildScrollView(
child: SelectionArea(
child: Text(
'Please email the below error to mobile@freecodecamp.org:\n\n${err.response!.data.toString()}\n\n${st.toString()}',
'Please email the below error to ${AuthenticationService.supportEmail}:\n\n${err.response!.data.toString()}\n\n${st.toString()}',
),
),
),
Expand All @@ -247,7 +248,7 @@ class AuthenticationService {
onPressed: () async {
logout();
await launchUrl(Uri.parse(
'mailto:$supportEmail?subject=$subject&body=$body'));
'mailto:${AuthenticationService.supportEmail}?subject=$subject&body=$body'));
Navigator.pop(context);
},
child: const Text('Email Error'),
Expand All @@ -267,7 +268,7 @@ class AuthenticationService {
);
} else {
String body = Uri.encodeComponent(
'Please email the below error to mobile@freecodecamp.org\n\n${err.toString()}\n\n${st.toString()}');
'Please email the below error to ${AuthenticationService.supportEmail}\n\n${err.toString()}\n\n${st.toString()}');
await showDialog(
context: context,
barrierDismissible: false,
Expand All @@ -283,7 +284,7 @@ class AuthenticationService {
content: SingleChildScrollView(
child: SelectionArea(
child: Text(
'Please email the below error to mobile@freecodecamp.org:\n\n${err.toString()}\n\n${st.toString()}',
'Please email the below error to ${AuthenticationService.supportEmail}:\n\n${err.toString()}\n\n${st.toString()}',
),
),
),
Expand All @@ -295,7 +296,7 @@ class AuthenticationService {
onPressed: () async {
logout();
await launchUrl(Uri.parse(
'mailto:$supportEmail?subject=$subject&body=$body'));
'mailto:${AuthenticationService.supportEmail}?subject=$subject&body=$body'));
Navigator.pop(context);
},
child: const Text('Email Error'),
Expand Down
Loading