fix crash in ViewThreadFragment (#3250)
This commit is contained in:
parent
fac62a638e
commit
07a4e97e9b
1 changed files with 2 additions and 1 deletions
|
@ -24,6 +24,7 @@ import android.widget.LinearLayout
|
||||||
import androidx.annotation.CheckResult
|
import androidx.annotation.CheckResult
|
||||||
import androidx.fragment.app.commit
|
import androidx.fragment.app.commit
|
||||||
import androidx.fragment.app.viewModels
|
import androidx.fragment.app.viewModels
|
||||||
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
|
@ -211,7 +212,7 @@ class ViewThreadFragment : SFragment(), OnRefreshListener, StatusActionListener,
|
||||||
threadProgressBar.cancel()
|
threadProgressBar.cancel()
|
||||||
|
|
||||||
adapter.submitList(uiState.statusViewData) {
|
adapter.submitList(uiState.statusViewData) {
|
||||||
if (viewModel.isInitialLoad) {
|
if (lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED) && viewModel.isInitialLoad) {
|
||||||
viewModel.isInitialLoad = false
|
viewModel.isInitialLoad = false
|
||||||
|
|
||||||
// Ensure the top of the status is visible
|
// Ensure the top of the status is visible
|
||||||
|
|
Loading…
Reference in a new issue