mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-21 11:00:06 +01:00
Changed result if nothing has been imported
This commit is contained in:
parent
6614539186
commit
cd899849fe
@ -335,6 +335,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
when (importResult) {
|
when (importResult) {
|
||||||
NotesHelper.ImportResult.IMPORT_OK -> toast(R.string.importing_successful)
|
NotesHelper.ImportResult.IMPORT_OK -> toast(R.string.importing_successful)
|
||||||
NotesHelper.ImportResult.IMPORT_PARTIAL -> toast(R.string.importing_some_entries_failed)
|
NotesHelper.ImportResult.IMPORT_PARTIAL -> toast(R.string.importing_some_entries_failed)
|
||||||
|
NotesHelper.ImportResult.IMPORT_NOTHING_NEW -> toast(R.string.no_new_items)
|
||||||
else -> toast(R.string.importing_failed)
|
else -> toast(R.string.importing_failed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,9 +115,8 @@ class NotesHelper(val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val result = when {
|
val result = when {
|
||||||
skipped == notes.size -> ImportResult.IMPORT_NOTHING_NEW
|
skipped == notes.size || imported == 0 -> ImportResult.IMPORT_NOTHING_NEW
|
||||||
imported == notes.size -> ImportResult.IMPORT_OK
|
imported == notes.size -> ImportResult.IMPORT_OK
|
||||||
imported == 0 -> ImportResult.IMPORT_FAIL
|
|
||||||
else -> ImportResult.IMPORT_PARTIAL
|
else -> ImportResult.IMPORT_PARTIAL
|
||||||
}
|
}
|
||||||
callback(result)
|
callback(result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user