Fix HistoryScene history delete, #629
This commit is contained in:
1 parent
5434b1ce19
commit
05a5be336e
1 file changed
+9
-3
@@ -55,6 +55,8 @@ import com.hippo.widget.LoadImageView
|
||||
import com.hippo.widget.recyclerview.AutoStaggeredGridLayoutManager
|
||||
import com.hippo.yorozuya.ViewUtils
|
||||
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||
import eu.kanade.tachiyomi.util.lang.launchIO
|
||||
import eu.kanade.tachiyomi.util.lang.withUIContext
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import rikka.core.res.resolveColor
|
||||
@@ -450,9 +452,13 @@ class HistoryScene : BaseToolbarScene() {
|
||||
|
||||
override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
|
||||
val mPosition = viewHolder.bindingAdapterPosition
|
||||
val info: HistoryInfo? = mAdapter.peek(mPosition)
|
||||
info?.let { EhDB.deleteHistoryInfo(info) }
|
||||
mAdapter.refresh()
|
||||
lifecycleScope.launchIO {
|
||||
val info: HistoryInfo? = mAdapter.peek(mPosition)
|
||||
info?.let { EhDB.deleteHistoryInfo(info) }
|
||||
withUIContext {
|
||||
mAdapter.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user