Merge branch 'upgrade-rn-and-friends' into 'master'
Upgrade RN and friends Closes #491 See merge request bloodyhealth/drip!336
This commit is contained in:
@@ -105,7 +105,8 @@ class DayColumn extends Component {
|
||||
/>
|
||||
|
||||
{ symptomRowSymptoms.map((symptom, i) => {
|
||||
const hasSymptomData = this.data.hasOwnProperty(symptom)
|
||||
const hasSymptomData =
|
||||
Object.prototype.hasOwnProperty.call(this.data, symptom)
|
||||
return (
|
||||
<SymptomCell
|
||||
index={i}
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { Component } from 'react'
|
||||
import { StyleSheet, View } from 'react-native'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Keyboard } from 'react-native'
|
||||
import DateTimePicker from 'react-native-modal-datetime-picker-nevo'
|
||||
import DateTimePicker from 'react-native-modal-datetime-picker'
|
||||
import moment from 'moment'
|
||||
|
||||
import AppText from '../common/app-text'
|
||||
|
||||
@@ -265,7 +265,8 @@ export const save = {
|
||||
const isDataEntered = ['feeling', 'texture'].some(
|
||||
value => isNumber(data[value]))
|
||||
const valuesToSave = shouldDeleteData || !isDataEntered
|
||||
? null : { feeling, texture, value: computeNfpValue(feeling, texture), exclude }
|
||||
? null
|
||||
: { feeling, texture, value: computeNfpValue(feeling, texture), exclude }
|
||||
|
||||
saveSymptom('mucus', date, valuesToSave)
|
||||
},
|
||||
|
||||
@@ -33,7 +33,8 @@ export default async function exportData() {
|
||||
url: `file://${path}`,
|
||||
subject: labels.subject,
|
||||
type: 'text/csv',
|
||||
showAppsToView: true
|
||||
showAppsToView: true,
|
||||
failOnCancel: false,
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Alert } from 'react-native'
|
||||
import { DocumentPicker, DocumentPickerUtil } from 'react-native-document-picker'
|
||||
import DocumentPicker from 'react-native-document-picker'
|
||||
import rnfs from 'react-native-fs'
|
||||
import importCsv from '../../../lib/import-export/import-from-csv'
|
||||
import { shared as sharedLabels } from '../../../i18n/en/labels'
|
||||
@@ -25,17 +25,16 @@ export function openImportDialog(onImportData) {
|
||||
export async function getFileContent() {
|
||||
let fileInfo
|
||||
try {
|
||||
fileInfo = await new Promise((resolve, reject) => {
|
||||
DocumentPicker.show({
|
||||
filetype: [DocumentPickerUtil.allFiles()],
|
||||
}, (err, res) => {
|
||||
if (err) return reject(err)
|
||||
resolve(res)
|
||||
})
|
||||
fileInfo = await DocumentPicker.pick({
|
||||
type: [DocumentPicker.types.csv, 'text/comma-separated-values'],
|
||||
})
|
||||
} catch (err) {
|
||||
// because cancelling also triggers an error, we do nothing here
|
||||
return
|
||||
} catch (error) {
|
||||
if (DocumentPicker.isCancel(error)) {
|
||||
// User cancelled the picker, exit any dialogs or menus and move on
|
||||
return
|
||||
} else {
|
||||
importError(error)
|
||||
}
|
||||
}
|
||||
|
||||
let fileContent
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react'
|
||||
import DateTimePicker from 'react-native-modal-datetime-picker-nevo'
|
||||
import DateTimePicker from 'react-native-modal-datetime-picker'
|
||||
|
||||
import AppSwitch from '../../common/app-switch'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user