mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-10 16:02:05 -04:00
Improve formatting and omit this
This commit is contained in:
parent
537b2be914
commit
3be699c994
@ -45,15 +45,17 @@ data class DeleteFiles(private val booksOnDiskListItems: List<BookOnDisk>) :
|
|||||||
|
|
||||||
dialogShower.show(DeleteZims(name), {
|
dialogShower.show(DeleteZims(name), {
|
||||||
activity.toast(
|
activity.toast(
|
||||||
if (booksOnDiskListItems.deleteAll())
|
if (booksOnDiskListItems.deleteAll()) {
|
||||||
R.string.delete_zims_toast else
|
R.string.delete_zims_toast
|
||||||
|
} else {
|
||||||
R.string.delete_zim_failed
|
R.string.delete_zim_failed
|
||||||
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun List<BookOnDisk>.deleteAll(): Boolean {
|
private fun List<BookOnDisk>.deleteAll(): Boolean {
|
||||||
return this.fold(true) { acc, book ->
|
return fold(true) { acc, book ->
|
||||||
acc && deleteSpecificZimFile(book).also {
|
acc && deleteSpecificZimFile(book).also {
|
||||||
if (it && book.file.canonicalPath == zimReaderContainer.zimCanonicalPath) {
|
if (it && book.file.canonicalPath == zimReaderContainer.zimCanonicalPath) {
|
||||||
zimReaderContainer.setZimFile(null)
|
zimReaderContainer.setZimFile(null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user