Fix read history removal

This commit is contained in:
Jobobby04 2020-06-12 19:31:33 -04:00
parent e30694c12c
commit 4382deb943

View File

@ -103,8 +103,8 @@ class HistoryPresenter : BasePresenter<HistoryController>() {
*/
fun removeFromHistory(history: History) {
history.last_read = 0L
db.updateHistoryLastRead(history).asRxObservable()
.subscribe()
db.updateHistoryLastRead(history).executeAsBlocking()
updateList()
}
fun updateList(search: String? = null) {
@ -123,12 +123,10 @@ class HistoryPresenter : BasePresenter<HistoryController>() {
* @param mangaId id of manga
*/
fun removeAllFromHistory(mangaId: Long) {
db.getHistoryByMangaId(mangaId).asRxSingle()
.map { list ->
list.forEach { it.last_read = 0L }
db.updateHistoryLastRead(list).executeAsBlocking()
}
.subscribe()
val history = db.getHistoryByMangaId(mangaId).executeAsBlocking()
history.forEach { it.last_read = 0L }
db.updateHistoryLastRead(history).executeAsBlocking()
updateList()
}
/**