Merge branch 'fix-empty-data-export' into 'master'
Fix export of empty database Closes #260 See merge request bloodyhealth/drip!129
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import Share from 'react-native-share'
|
||||
import getDataAsCsvDataUri from '../../lib/import-export/export-to-csv'
|
||||
import alertError from './alert-error'
|
||||
import { settings as labels } from '../../i18n/en/settings'
|
||||
import { settings } from '../../i18n/en/settings'
|
||||
|
||||
export default async function openShareDialogAndExport() {
|
||||
let data
|
||||
const labels = settings.export
|
||||
try {
|
||||
data = getDataAsCsvDataUri()
|
||||
if (!data) {
|
||||
@@ -17,15 +18,15 @@ export default async function openShareDialogAndExport() {
|
||||
|
||||
try {
|
||||
await Share.open({
|
||||
title: labels.export.title,
|
||||
title: labels.title,
|
||||
url: data,
|
||||
subject: labels.export.subject,
|
||||
subject: labels.subject,
|
||||
type: 'text/csv',
|
||||
showAppsToView: true
|
||||
})
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
return alertError(labels.export.errors.problemSharing)
|
||||
return alertError(labels.errors.problemSharing)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user