mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-03 19:47:33 +01:00
fix(ui): prevent duplication in comment and post creation
This commit is contained in:
parent
77f9e6ed03
commit
09b4e5f526
@ -47,6 +47,10 @@ class CreateCommentViewModel(
|
||||
}
|
||||
|
||||
private fun submit() {
|
||||
if (mvi.uiState.value.loading) {
|
||||
return
|
||||
}
|
||||
|
||||
mvi.updateState {
|
||||
it.copy(
|
||||
textError = null,
|
||||
@ -66,8 +70,8 @@ class CreateCommentViewModel(
|
||||
return
|
||||
}
|
||||
|
||||
mvi.updateState { it.copy(loading = true) }
|
||||
mvi.scope?.launch(Dispatchers.IO) {
|
||||
mvi.updateState { it.copy(loading = true) }
|
||||
try {
|
||||
val auth = identityRepository.authToken.value.orEmpty()
|
||||
if (postId != null) {
|
||||
|
@ -76,6 +76,10 @@ class CreatePostViewModel(
|
||||
}
|
||||
|
||||
private fun submit() {
|
||||
if (mvi.uiState.value.loading) {
|
||||
return
|
||||
}
|
||||
|
||||
mvi.updateState {
|
||||
it.copy(
|
||||
titleError = null,
|
||||
@ -116,8 +120,8 @@ class CreatePostViewModel(
|
||||
return
|
||||
}
|
||||
|
||||
mvi.updateState { it.copy(loading = true) }
|
||||
mvi.scope?.launch(Dispatchers.IO) {
|
||||
mvi.updateState { it.copy(loading = true) }
|
||||
try {
|
||||
val auth = identityRepository.authToken.value.orEmpty()
|
||||
when {
|
||||
|
Loading…
x
Reference in New Issue
Block a user