Go back to using modal

This commit is contained in:
Mo Bitar
2017-10-04 19:58:03 -05:00
parent e4d8784177
commit cc5c38d3bd
2 changed files with 9 additions and 27 deletions

View File

@@ -16,7 +16,6 @@ export default class AuthModal extends Component {
this.stateObserver = ApplicationState.get().addStateObserver((state) => {
let authProps = ApplicationState.get().getAuthenticationPropsForAppState(state);
console.log("GOt auth props", authProps);
this.setState({authProps: authProps});
});
}
@@ -29,8 +28,12 @@ export default class AuthModal extends Component {
let authProps = this.state.authProps;
let visible = (authProps.passcode || authProps.fingerprint) || false;
return (
<View style={GlobalStyles.styles().flexContainer}>
{visible &&
<Modal
animationType={"slide"}
transparent={false}
visible={visible}
onRequestClose={() => {}}>
<Authenticate
ref={'authenticate'}
title={authProps.title}
@@ -41,9 +44,8 @@ export default class AuthModal extends Component {
pseudoModal={true}
authProps={authProps}
/>
}
</View>
)
</Modal>
)
}
}

View File

@@ -38,7 +38,7 @@ export default class Notes extends Abstract {
this.props.navigator.popToRoot();
// Don't use the below as it will also for some reason dismiss the non RNN auth modal as well
this.props.navigator.dismissAllModals({animationType: 'none'});
// this.props.navigator.dismissAllModals({animationType: 'none'});
this.props.navigator.switchToTab({
tabIndex: 0
@@ -48,12 +48,6 @@ export default class Notes extends Abstract {
})
}
// Implemented by super class. We just want to latch on so we can configure the nav bar.
unlockContent() {
super.unlockContent();
this.configureNavBar(true);
}
loadInitialState() {
this.options = App.get().globalOptions();
@@ -143,21 +137,7 @@ export default class Notes extends Abstract {
}
configureNavBar(initial = false) {
if(this.state.lockContent) {
this.notesTitle = "Authentication Required";
this.props.navigator.setTitle({title: this.notesTitle, animated: false});
this.props.navigator.setButtons({
rightButtons: [],
leftButtons: [],
fab: {},
animated: false
});
return;
}
if(!this.dataLoaded) {
this.notesTitle = "Notes";
this.props.navigator.setTitle({title: this.notesTitle, animated: false});
return;
}