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

Revert "Feature Hand Back Key for Android" #835

Merged
merged 1 commit into from
Jun 17, 2016
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions src/Reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {

import { assert } from './Util';
import { getInitialState } from './State';
import { Platform } from 'react-native';

// WARN: it is not working correct. rewrite it.
function checkPropertiesEqual(action, lastAction) {
Expand Down Expand Up @@ -73,11 +72,6 @@ function inject(state, action, props, scenes) {
case POP_ACTION2:
case POP_ACTION: {
assert(!state.tabs, 'pop() operation cannot be run on tab bar (tabs=true)');

if (Platform.OS === 'android') {
assert(state.index > 0, 'You are already in the root scene.');
}

if (state.index === 0) {
return state;
}
Expand Down
10 changes: 0 additions & 10 deletions src/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import React, {
Component,
PropTypes,
} from 'react';
import { BackAndroid } from 'react-native';
import NavigationExperimental from 'react-native-experimental-navigation';

import Actions from './Actions';
Expand Down Expand Up @@ -99,15 +98,6 @@ class Router extends Component {
render() {
if (!this.state.reducer) return null;

BackAndroid.addEventListener('hardwareBackPress', () => {
try {
Actions.pop();
return true;
} catch (err) {
return false;
}
});

return (
<NavigationRootContainer
reducer={this.state.reducer}
Expand Down