Merge branch 'chore/realm-upgrade' into 'master'
Chore/realm upgrade See merge request bloodyhealth/drip!393
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { ChronoUnit, LocalDate, LocalTime } from 'js-joda'
|
||||
|
||||
import { getPreviousTemperatureForDate, saveSymptom } from '../../db'
|
||||
import {
|
||||
getPreviousTemperatureForDate,
|
||||
saveSymptom,
|
||||
mapRealmObjToJsObj,
|
||||
} from '../../db'
|
||||
import { scaleObservable } from '../../local-storage'
|
||||
|
||||
import * as labels from '../../i18n/en/cycle-day'
|
||||
@@ -383,6 +387,7 @@ const label = {
|
||||
}
|
||||
},
|
||||
sex: (sex) => {
|
||||
sex = mapRealmObjToJsObj(sex)
|
||||
const sexLabel = []
|
||||
if (sex && Object.values({ ...sex }).some((val) => val)) {
|
||||
Object.keys(sex).forEach((key) => {
|
||||
@@ -401,6 +406,7 @@ const label = {
|
||||
}
|
||||
},
|
||||
pain: (pain) => {
|
||||
pain = mapRealmObjToJsObj(pain)
|
||||
const painLabel = []
|
||||
if (pain && Object.values({ ...pain }).some((val) => val)) {
|
||||
Object.keys(pain).forEach((key) => {
|
||||
@@ -419,6 +425,7 @@ const label = {
|
||||
}
|
||||
},
|
||||
mood: (mood) => {
|
||||
mood = mapRealmObjToJsObj(mood)
|
||||
const moodLabel = []
|
||||
if (mood && Object.values({ ...mood }).some((val) => val)) {
|
||||
Object.keys(mood).forEach((key) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Share from 'react-native-share'
|
||||
|
||||
import { getCycleDaysSortedByDate } from '../../../db'
|
||||
import { getCycleDaysSortedByDate, mapRealmObjToJsObj } from '../../../db'
|
||||
import getDataAsCsvDataUri from '../../../lib/import-export/export-to-csv'
|
||||
import alertError from '../common/alert-error'
|
||||
import settings from '../../../i18n/en/settings'
|
||||
@@ -10,7 +10,7 @@ import RNFS from 'react-native-fs'
|
||||
export default async function exportData() {
|
||||
let data
|
||||
const labels = settings.export
|
||||
const cycleDaysByDate = getCycleDaysSortedByDate()
|
||||
const cycleDaysByDate = mapRealmObjToJsObj(getCycleDaysSortedByDate())
|
||||
|
||||
if (!cycleDaysByDate.length) return alertError(labels.errors.noData)
|
||||
|
||||
@@ -36,10 +36,8 @@ export default async function exportData() {
|
||||
showAppsToView: true,
|
||||
failOnCancel: false,
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
return alertError(labels.errors.problemSharing)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user