Move create password flow to settings page

This commit is contained in:
Julia Friesel
2018-09-14 15:15:13 +02:00
parent c476a7a278
commit f6e8950816
4 changed files with 84 additions and 50 deletions
+1 -22
View File
@@ -6,10 +6,9 @@ import {
ScrollView
} from 'react-native'
import { LocalDate, ChronoUnit } from 'js-joda'
import nodejs from 'nodejs-mobile-react-native'
import styles from '../styles/index'
import cycleModule from '../lib/cycle'
import { requestHash, getOrCreateCycleDay, getBleedingDaysSortedByDate, fillWithMucusDummyData, fillWithCervixDummyData, changeEncryptionAndRestartApp } from '../db'
import { getOrCreateCycleDay, getBleedingDaysSortedByDate, fillWithMucusDummyData, fillWithCervixDummyData } from '../db'
import {bleedingPrediction as labels} from './labels'
export default class Home extends Component {
@@ -35,22 +34,10 @@ export default class Home extends Component {
})(this)
getBleedingDaysSortedByDate().addListener(this.setStateWithCurrentText)
this.startEncryption = async (msg) => {
msg = JSON.parse(msg)
changeEncryptionAndRestartApp(msg.message)
}
nodejs.channel.addListener(
'message',
this.startEncryption,
this
)
}
componentWillUnmount() {
getBleedingDaysSortedByDate().removeListener(this.setStateWithCurrentText)
nodejs.channel.removeListener('message', this.startEncryption)
}
passTodayToDayView() {
@@ -84,14 +71,6 @@ export default class Home extends Component {
title="fill with example data for cervix&temp">
</Button>
</View>
<View style={styles.homeButton}>
<Button
onPress={() => {
requestHash()
}}
title="encrypt, yo">
</Button>
</View>
</View>
</ScrollView>
)