Show toasts only on failure

This commit is contained in:
Naveen 2023-03-24 17:12:02 +05:30
parent a2655c3231
commit f86dafd528

View File

@ -248,14 +248,12 @@ fun Context.backupEventsAndTasks() {
null
}
IcsExporter(this).exportEvents(outputStream, events, true) { result ->
toast(
when (result) {
IcsExporter.ExportResult.EXPORT_OK -> R.string.exporting_successful
IcsExporter.ExportResult.EXPORT_PARTIAL -> R.string.exporting_some_entries_failed
else -> R.string.exporting_failed
}
)
IcsExporter(this).exportEvents(outputStream, events, showExportingToast = false) { result ->
when (result) {
IcsExporter.ExportResult.EXPORT_PARTIAL -> toast(R.string.exporting_some_entries_failed)
IcsExporter.ExportResult.EXPORT_FAIL -> toast(R.string.exporting_failed)
else -> {}
}
config.lastAutoBackupTime = getNowSeconds()
}
scheduleNextAutomaticBackup()