From 56e99912d43e1ec05b986d62cbbf4542fbd7531d Mon Sep 17 00:00:00 2001 From: klaus Date: Wed, 10 Sep 2025 13:51:07 +0900 Subject: [PATCH] =?UTF-8?q?"fix(chat-room):=20=EC=BF=BC=ED=84=B0=20UI?= =?UTF-8?q?=EB=A5=BC=20totalRemaining=20=EB=8C=80=EC=8B=A0=20nextRechargeA?= =?UTF-8?q?tEpoch=20=EA=B8=B0=EC=A4=80=EC=9C=BC=EB=A1=9C=20=EA=B0=B1?= =?UTF-8?q?=EC=8B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/talk/room/ChatRoomActivity.kt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/kr/co/vividnext/sodalive/chat/talk/room/ChatRoomActivity.kt b/app/src/main/java/kr/co/vividnext/sodalive/chat/talk/room/ChatRoomActivity.kt index dd088a2a..9e33a5e5 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/chat/talk/room/ChatRoomActivity.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/chat/talk/room/ChatRoomActivity.kt @@ -379,7 +379,7 @@ class ChatRoomActivity : BaseActivity( } // 응답에 포함된 쿼터 상태로 UI 갱신 - updateQuotaUi(response.totalRemaining, response.nextRechargeAtEpoch) + updateQuotaUi(response.nextRechargeAtEpoch) }, { error -> // 실패: 타이핑 인디케이터 제거 및 FAILED로 업데이트 chatAdapter.hideTypingIndicator() @@ -466,7 +466,7 @@ class ChatRoomActivity : BaseActivity( .observeOn(AndroidSchedulers.mainThread()) .subscribe({ resp -> // 쿼터 UI 갱신 - updateQuotaUi(resp.totalRemaining, resp.nextRechargeAtEpoch) + updateQuotaUi(resp.nextRechargeAtEpoch) // 결제 성공 시 로컬 캔 차감(30캔) 및 헤더 배지 즉시 반영 val newCan = (SharedPreferenceManager.can - 30).coerceAtLeast(0) @@ -478,18 +478,18 @@ class ChatRoomActivity : BaseActivity( ) } - private fun updateQuotaUi(totalRemaining: Int, nextRechargeAtEpoch: Long?) { - if (totalRemaining > 0) { - // 입력창 표시 및 안내 제거 - binding.inputContainer.isVisible = true - stopQuotaCountdown() - ensureQuotaNoticeRemoved() - } else { + private fun updateQuotaUi(nextRechargeAtEpoch: Long?) { + if (nextRechargeAtEpoch != null) { // 입력창 숨김 및 안내 표시 + 카운트다운 시작 binding.inputContainer.isVisible = false val timeText = formatEpochToHms(nextRechargeAtEpoch) ensureQuotaNoticeShown(timeText) startQuotaCountdown(nextRechargeAtEpoch) + } else { + // 입력창 표시 및 안내 제거 + binding.inputContainer.isVisible = true + stopQuotaCountdown() + ensureQuotaNoticeRemoved() } } @@ -551,7 +551,7 @@ class ChatRoomActivity : BaseActivity( chatRepository.getChatQuotaStatus(roomId, token) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ resp -> - updateQuotaUi(resp.totalRemaining, resp.nextRechargeAtEpoch) + updateQuotaUi(resp.nextRechargeAtEpoch) }, { /* 무시: 다음 틱에 재시도 가능 */ }) ) } @@ -655,7 +655,7 @@ class ChatRoomActivity : BaseActivity( isLoading = false // 쿼터 UI 갱신 - updateQuotaUi(response.totalRemaining, response.nextRechargeAtEpoch) + updateQuotaUi(response.nextRechargeAtEpoch) // 7.3: 오래된 메시지 정리(백그라운드) compositeDisposable.add(