mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(browse): Unsubscribe before restarting pager
This commit is contained in:
parent
9e5262140e
commit
3606f67dba
2 changed files with 7 additions and 0 deletions
|
@ -752,6 +752,11 @@ open class BrowseSourceController(bundle: Bundle) :
|
|||
binding.progress.isVisible = false
|
||||
}
|
||||
|
||||
fun unsubscribe() {
|
||||
watchJob?.cancel()
|
||||
watchJob = null
|
||||
}
|
||||
|
||||
/**
|
||||
* Workaround to fix data state de-sync issues when controller detached,
|
||||
* and attaching flow directly into Item caused some flickering issues.
|
||||
|
|
|
@ -171,6 +171,8 @@ open class BrowseSourcePresenter(
|
|||
val sourceListType = preferences.libraryLayout()
|
||||
val outlineCovers = uiPreferences.outlineOnCovers()
|
||||
|
||||
view?.unsubscribe()
|
||||
|
||||
// Prepare the pager.
|
||||
pagerJob?.cancel()
|
||||
pagerJob = presenterScope.launchIO {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue