Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prop for alerting the user before exiting app #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nmquebb
Copy link

@nmquebb nmquebb commented Jan 28, 2017

I've been getting some complaints from user's about the app just exiting. I'm not an Android user so I don't know if that's expected behavior or not, but I thought it would be nice to add an option alert before leaving the app.

@mention-bot
Copy link

@nmquebb, thanks for your PR! By analyzing the history of the files in this pull request, we identified @SEthX, @charpeni and @AnNOtis to be potential reviewers.

@nmquebb
Copy link
Author

nmquebb commented Feb 3, 2017

?

@charpeni
Copy link
Contributor

Thank you @nmquebb, I'll review this soon.

@charpeni charpeni self-requested a review February 16, 2017 00:46
Copy link
Contributor

@charpeni charpeni left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution and sorry for the delay.

The back button will only exit the current application if it's the last route in the stack, it's the expected behaviour.

However, it could be nice to have this, but I would highly prefer a callback or something more customizable than a hardcoded alert that can't be translated.

@@ -17,6 +18,7 @@ const propTypes = {
currentRoute: PropTypes.object.isRequired,
customAction: PropTypes.func,
handleBackAndroid: PropTypes.bool,
alertAndroidExit: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: alphabetical order

@@ -70,10 +72,19 @@ class NavBarContainer extends React.Component {
BackAndroid.addEventListener('hardwareBackPress', () => {
if (this.props.currentRoute.index > 0) {
this.goBack();
return true;
} else {
console.log('dsa')
Copy link
Contributor

Choose a reason for hiding this comment

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

These console.log should not be commited.

@@ -23,6 +23,7 @@ const propTypes = {
customAction: PropTypes.func,
firstRoute: PropTypes.object.isRequired,
handleBackAndroid: PropTypes.bool,
alertAndroidExit: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: alphabetical order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants