|
|
|
|
@ -74,7 +74,6 @@ class TasksJsonExporter @Inject constructor(
|
|
|
|
|
try {
|
|
|
|
|
val filename = getFileName(exportType)
|
|
|
|
|
val tasks = taskDao.getAll()
|
|
|
|
|
if (tasks.isNotEmpty()) {
|
|
|
|
|
val file = File(String.format("%s/%s", context!!.filesDir, BackupConstants.INTERNAL_BACKUP))
|
|
|
|
|
file.delete()
|
|
|
|
|
file.createNewFile()
|
|
|
|
|
@ -91,7 +90,6 @@ class TasksJsonExporter @Inject constructor(
|
|
|
|
|
FileHelper.copyStream(context!!, internalStorageBackup, externalStorageBackup)
|
|
|
|
|
workManager.scheduleDriveUpload(externalStorageBackup, exportType == ExportType.EXPORT_TYPE_SERVICE)
|
|
|
|
|
BackupManager(context).dataChanged()
|
|
|
|
|
}
|
|
|
|
|
if (exportType == ExportType.EXPORT_TYPE_MANUAL) {
|
|
|
|
|
onFinishExport(filename)
|
|
|
|
|
}
|
|
|
|
|
|