Fix NavigatorIOS freeze when pushing before initialization completes

Summary:
This freezes the app in the UIExplorer because we try to push a new view controller onto the screen before the navigator finishes loading. This was exacerbated by @tadeuzagallo's diff that made the loading even faster. Hehe
This commit is contained in:
Alex Akers 2015-08-13 08:05:09 -07:00
parent 7232b1bbc7
commit f552495e7f
1 changed files with 0 additions and 27 deletions

View File

@ -123,32 +123,6 @@ class UIExplorerList extends React.Component {
);
}
componentDidMount() {
var wasUIExplorer = false;
var didOpenExample = false;
this.props.navigator.navigationContext.addListener('didfocus', (event) => {
var isUIExplorer = event.data.route.title === 'UIExplorer';
if (!didOpenExample && isUIExplorer) {
didOpenExample = true;
var visibleExampleTitle = Settings.get('visibleExample');
if (visibleExampleTitle) {
var predicate = (example) => example.title === visibleExampleTitle;
var foundExample = APIS.find(predicate) || COMPONENTS.find(predicate);
if (foundExample) {
setTimeout(() => this._openExample(foundExample), 100);
}
} else if (!wasUIExplorer && isUIExplorer) {
Settings.set({visibleExample: null});
}
}
wasUIExplorer = isUIExplorer;
});
}
renderAdditionalView(renderRow: Function, renderTextInput: Function): React.Component {
return renderTextInput(styles.searchTextInput);
}
@ -171,7 +145,6 @@ class UIExplorerList extends React.Component {
}
onPressRow(example: any) {
Settings.set({visibleExample: example.title});
this._openExample(example);
}
}