mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Update booksOnDiskListItem variable name
This commit is contained in:
parent
fbf7c50f78
commit
ce6ded65d2
@ -31,7 +31,7 @@ import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDis
|
|||||||
import org.kiwix.kiwixmobile.zim_manager.ZimManageActivity
|
import org.kiwix.kiwixmobile.zim_manager.ZimManageActivity
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
data class DeleteFiles(private val booksOnDiskListItem: List<BookOnDisk>) :
|
data class DeleteFiles(private val booksOnDiskListItems: List<BookOnDisk>) :
|
||||||
SideEffect<Unit> {
|
SideEffect<Unit> {
|
||||||
|
|
||||||
@Inject lateinit var dialogShower: DialogShower
|
@Inject lateinit var dialogShower: DialogShower
|
||||||
@ -41,18 +41,19 @@ data class DeleteFiles(private val booksOnDiskListItem: List<BookOnDisk>) :
|
|||||||
override fun invokeWith(activity: AppCompatActivity) {
|
override fun invokeWith(activity: AppCompatActivity) {
|
||||||
(activity as ZimManageActivity).cachedComponent.inject(this)
|
(activity as ZimManageActivity).cachedComponent.inject(this)
|
||||||
|
|
||||||
val name = booksOnDiskListItem.joinToString(separator = "\n") { it.book.title }
|
val name = booksOnDiskListItems.joinToString(separator = "\n") { it.book.title }
|
||||||
|
|
||||||
dialogShower.show(DeleteZims(name), {
|
dialogShower.show(DeleteZims(name), {
|
||||||
val booksDeleted = booksOnDiskListItem.fold(true) { _, book ->
|
val booksDeleted = booksOnDiskListItems.fold(true) { acc, book ->
|
||||||
if (deleteSpecificZimFile(book)) {
|
acc &&
|
||||||
if (book.file.canonicalPath == zimReaderContainer.zimCanonicalPath) {
|
(if (deleteSpecificZimFile(book)) {
|
||||||
zimReaderContainer.setZimFile(null)
|
if (book.file.canonicalPath == zimReaderContainer.zimCanonicalPath) {
|
||||||
}
|
zimReaderContainer.setZimFile(null)
|
||||||
true
|
}
|
||||||
} else {
|
true
|
||||||
false
|
} else {
|
||||||
}
|
false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.toast(if (booksDeleted) R.string.delete_zims_toast else R.string.delete_zim_failed)
|
activity.toast(if (booksDeleted) R.string.delete_zims_toast else R.string.delete_zim_failed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user