|
|
@ -131,7 +131,20 @@ export default class DataExportSection extends Vue { |
|
|
|
*/ |
|
|
|
public async exportDatabase() { |
|
|
|
try { |
|
|
|
const blob = await db.export({ prettyJson: true }); |
|
|
|
const blob = await db.export({ |
|
|
|
prettyJson: true, |
|
|
|
transform: (table, value, key) => { |
|
|
|
if (table === "contacts") { |
|
|
|
// Dexie inserts a number 0 when some are undefined, so we need to totally remove them. |
|
|
|
Object.keys(value).forEach(prop => { |
|
|
|
if (value[prop] === undefined) { |
|
|
|
delete value[prop]; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return { value, key }; |
|
|
|
}, |
|
|
|
}); |
|
|
|
const fileName = `${db.name}-backup.json`; |
|
|
|
|
|
|
|
if (this.platformCapabilities.hasFileDownload) { |
|
|
|