From 0046760f0a7907370d8c76cbb942b85ba6e1ae21 Mon Sep 17 00:00:00 2001 From: JSPark <48265129+pknujsp@users.noreply.github.com> Date: Thu, 8 Jun 2023 18:15:16 +0900 Subject: [PATCH] =?UTF-8?q?#91=20=EB=8C=93=EA=B8=80=20=EB=82=98=EC=98=A4?= =?UTF-8?q?=EB=8A=94=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 3 ++- .../commentsofamedicine/MedicineCommentsFragment.kt | 8 ++++---- .../commentsofamedicine/MedicineCommentsViewModel.kt | 6 ------ .../search/src/main/res/layout/manual_medicine_item.xml | 3 +-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index e8da491a1..5d6708198 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,10 +1,11 @@ + diff --git a/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsFragment.kt b/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsFragment.kt index 692a799cb..96515b31c 100644 --- a/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsFragment.kt +++ b/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsFragment.kt @@ -92,7 +92,7 @@ class MedicineCommentsFragment : is CommentActionState.COMPLETED_LIKE -> { action.result.fold(onSuccess = { - adapter.retry() + adapter.refresh() }, onFailure = { toast(it.message.toString()) }) @@ -103,7 +103,7 @@ class MedicineCommentsFragment : action.result.fold(onSuccess = { replyHeader.isVisible = false toast(getString(R.string.appliedComment)) - adapter.retry() + adapter.refresh() }, onFailure = { toast(it.message.toString()) }) @@ -111,7 +111,7 @@ class MedicineCommentsFragment : is CommentActionState.COMPLETED_APPLY_EDITED_COMMENT -> { action.result.fold(onSuccess = { - adapter.retry() + adapter.refresh() toast(getString(R.string.appliedEditComment)) }, onFailure = { toast(it.message.toString()) @@ -120,7 +120,7 @@ class MedicineCommentsFragment : is CommentActionState.COMPLETED_DELETE_COMMENT -> { action.result.fold(onSuccess = { - adapter.retry() + adapter.refresh() toast(getString(R.string.deletedComment)) }, onFailure = { toast(it.message.toString()) diff --git a/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsViewModel.kt b/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsViewModel.kt index e005589c4..2521eb382 100644 --- a/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsViewModel.kt +++ b/feature/comments/src/main/java/com/android/mediproject/feature/comments/commentsofamedicine/MedicineCommentsViewModel.kt @@ -29,7 +29,6 @@ import com.android.mediproject.feature.comments.commentsofamedicine.CommentActio import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.channels.BufferOverflow -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow @@ -113,7 +112,6 @@ class MedicineCommentsViewModel @Inject constructor( subOrdinationId = replyId.value.toString())).collectLatest { result -> result.onSuccess { // 댓글 등록 성공 - delay(200) commentsUseCase.scrollChannel.send(Unit) _action.emit(CommentActionState.COMPLETED_APPLY_COMMENT_REPLY(Result.success(Unit))) }.onFailure { @@ -134,7 +132,6 @@ class MedicineCommentsViewModel @Inject constructor( subOrdinationId = "0")).collectLatest { result -> result.onSuccess { // 댓글 등록 성공 - delay(200) commentsUseCase.scrollChannel.send(Unit) _action.emit(CommentActionState.COMPLETED_APPLY_COMMENT_REPLY(Result.success(Unit))) }.onFailure { @@ -156,7 +153,6 @@ class MedicineCommentsViewModel @Inject constructor( medicineId = medicineBasicInfo.replayCache.last().medicineIdInAws)).collectLatest { result -> result.onSuccess { // 댓글 수정 성공 - delay(200) _action.emit(CommentActionState.COMPLETED_APPLY_EDITED_COMMENT(Result.success(Unit))) }.onFailure { _action.emit(CommentActionState.COMPLETED_APPLY_EDITED_COMMENT(Result.failure(it))) @@ -201,7 +197,6 @@ class MedicineCommentsViewModel @Inject constructor( .collectLatest { result -> result.onSuccess { // 댓글 삭제 성공 - delay(200) commentsUseCase.scrollChannel.send(Unit) _action.emit(CommentActionState.COMPLETED_DELETE_COMMENT(Result.success(Unit))) }.onFailure { @@ -223,7 +218,6 @@ class MedicineCommentsViewModel @Inject constructor( .collectLatest { result -> result.onSuccess { // like 처리 완료 - delay(200) _action.emit(CommentActionState.COMPLETED_LIKE(Result.success(Unit))) }.onFailure { _action.emit(CommentActionState.COMPLETED_LIKE(Result.failure(it))) diff --git a/feature/search/src/main/res/layout/manual_medicine_item.xml b/feature/search/src/main/res/layout/manual_medicine_item.xml index 3c006d6ca..894b9d8a8 100644 --- a/feature/search/src/main/res/layout/manual_medicine_item.xml +++ b/feature/search/src/main/res/layout/manual_medicine_item.xml @@ -18,10 +18,9 @@