Skip to content

Commit cd89984

Browse files
committed
Changed result if nothing has been imported
1 parent 6614539 commit cd89984

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/SettingsActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ class SettingsActivity : SimpleActivity() {
335335
when (importResult) {
336336
NotesHelper.ImportResult.IMPORT_OK -> toast(R.string.importing_successful)
337337
NotesHelper.ImportResult.IMPORT_PARTIAL -> toast(R.string.importing_some_entries_failed)
338+
NotesHelper.ImportResult.IMPORT_NOTHING_NEW -> toast(R.string.no_new_items)
338339
else -> toast(R.string.importing_failed)
339340
}
340341
}

app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/NotesHelper.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ class NotesHelper(val context: Context) {
115115
}
116116

117117
val result = when {
118-
skipped == notes.size -> ImportResult.IMPORT_NOTHING_NEW
118+
skipped == notes.size || imported == 0 -> ImportResult.IMPORT_NOTHING_NEW
119119
imported == notes.size -> ImportResult.IMPORT_OK
120-
imported == 0 -> ImportResult.IMPORT_FAIL
121120
else -> ImportResult.IMPORT_PARTIAL
122121
}
123122
callback(result)

0 commit comments

Comments
 (0)