mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-08 22:08:47 +01:00
fix: comment loading in post detail (#1074)
This commit is contained in:
parent
4540ed4214
commit
ff2471ef3c
@ -185,10 +185,12 @@ class CommunityDetailViewModel(
|
|||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.debounce(1_000)
|
.debounce(1_000)
|
||||||
.onEach {
|
.onEach {
|
||||||
updateState { it.copy(loading = false) }
|
if (!uiState.value.initial) {
|
||||||
emitEffect(CommunityDetailMviModel.Effect.BackToTop)
|
updateState { it.copy(loading = false) }
|
||||||
delay(50)
|
emitEffect(CommunityDetailMviModel.Effect.BackToTop)
|
||||||
refresh()
|
delay(50)
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
}.launchIn(this)
|
}.launchIn(this)
|
||||||
|
|
||||||
lemmyValueCache.isCurrentUserAdmin
|
lemmyValueCache.isCurrentUserAdmin
|
||||||
|
@ -101,7 +101,7 @@ class ModalDrawerViewModel(
|
|||||||
uiState
|
uiState
|
||||||
.map { it.searchText }
|
.map { it.searchText }
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.debounce(1000)
|
.debounce(1_000)
|
||||||
.onEach {
|
.onEach {
|
||||||
refresh()
|
refresh()
|
||||||
}.launchIn(this)
|
}.launchIn(this)
|
||||||
|
@ -169,7 +169,7 @@ class ExploreViewModel(
|
|||||||
.map {
|
.map {
|
||||||
it.searchText
|
it.searchText
|
||||||
}.distinctUntilChanged()
|
}.distinctUntilChanged()
|
||||||
.debounce(1000)
|
.debounce(1_000)
|
||||||
.onEach {
|
.onEach {
|
||||||
if (!uiState.value.initial) {
|
if (!uiState.value.initial) {
|
||||||
emitEffect(ExploreMviModel.Effect.BackToTop)
|
emitEffect(ExploreMviModel.Effect.BackToTop)
|
||||||
|
@ -77,10 +77,12 @@ class ManageSubscriptionsViewModel(
|
|||||||
uiState
|
uiState
|
||||||
.map { it.searchText }
|
.map { it.searchText }
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.debounce(1000)
|
.debounce(1_000)
|
||||||
.onEach {
|
.onEach {
|
||||||
emitEffect(ManageSubscriptionsMviModel.Effect.BackToTop)
|
if (!uiState.value.initial) {
|
||||||
refresh()
|
emitEffect(ManageSubscriptionsMviModel.Effect.BackToTop)
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
}.launchIn(this)
|
}.launchIn(this)
|
||||||
if (uiState.value.communities.isEmpty()) {
|
if (uiState.value.communities.isEmpty()) {
|
||||||
refresh(initial = true)
|
refresh(initial = true)
|
||||||
|
@ -46,7 +46,7 @@ class MultiCommunityEditorViewModel(
|
|||||||
uiState
|
uiState
|
||||||
.map { it.searchText }
|
.map { it.searchText }
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.debounce(1000)
|
.debounce(1_000)
|
||||||
.onEach {
|
.onEach {
|
||||||
refresh()
|
refresh()
|
||||||
}.launchIn(this)
|
}.launchIn(this)
|
||||||
|
@ -182,9 +182,11 @@ class PostDetailViewModel(
|
|||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.debounce(1_000)
|
.debounce(1_000)
|
||||||
.onEach {
|
.onEach {
|
||||||
updateState { it.copy(loading = false) }
|
if (!uiState.value.initial) {
|
||||||
emitEffect(PostDetailMviModel.Effect.BackToTop)
|
updateState { it.copy(loading = false) }
|
||||||
refresh()
|
emitEffect(PostDetailMviModel.Effect.BackToTop)
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
}.launchIn(this)
|
}.launchIn(this)
|
||||||
|
|
||||||
identityRepository.isLogged
|
identityRepository.isLogged
|
||||||
|
@ -36,9 +36,11 @@ class SelectCommunityViewModel(
|
|||||||
uiState
|
uiState
|
||||||
.map { it.searchText }
|
.map { it.searchText }
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.debounce(1000)
|
.debounce(1_000)
|
||||||
.onEach {
|
.onEach {
|
||||||
refresh()
|
if (!uiState.value.initial) {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
}.launchIn(this)
|
}.launchIn(this)
|
||||||
|
|
||||||
if (uiState.value.initial) {
|
if (uiState.value.initial) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user