Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX/#196] 서버 종료 대응 #197

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,15 @@ class SelfieFragment : BaseFragment<FragmentSelfieBinding>(R.layout.fragment_sel
AmplitudeManager.trackEvent(
EVENT_CLICK_BTN, amplitudePage, mapOf(PROPERTY_BTN to "createpic"),
)
with(viewModel) {
if (isCreatingParentPic) {
startValidProcessLoading()
manager.purchaseProduct()
} else {
startSendingImages()
}
}
// with(viewModel) {
// if (isCreatingParentPic) {
// startValidProcessLoading()
// manager.purchaseProduct()
// } else {
// startSendingImages()
// }
// }
toast(stringOf(R.string.toast_service_finished))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ package kr.genti.presentation.main
import android.os.Bundle
import android.view.View
import android.view.WindowManager
import androidx.fragment.app.activityViewModels
import kr.genti.core.base.BaseDialog
import kr.genti.core.extension.setOnSingleClickListener
import kr.genti.presentation.R
import kr.genti.presentation.databinding.DialogCreateUnableBinding

class CreateUnableDialog : BaseDialog<DialogCreateUnableBinding>(R.layout.dialog_create_unable) {

private val viewModel by activityViewModels<MainViewModel>()

override fun onStart() {
super.onStart()
dialog?.window?.apply {
Expand All @@ -31,7 +35,10 @@ class CreateUnableDialog : BaseDialog<DialogCreateUnableBinding>(R.layout.dialog
}

private fun initCloseBtnListener() {
binding.btnReturn.setOnSingleClickListener { dismiss() }
binding.btnReturn.setOnSingleClickListener {
viewModel.getIsUserVerifiedFromServer()
dismiss()
}
}

private fun setBodyText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>(R.layout.activity_main) {
viewModel.serverAvailableState.flowWithLifecycle(lifecycle).onEach { state ->
when (state) {
is UiState.Success -> {
if (state.data.status) {
viewModel.getIsUserVerifiedFromServer()
} else {
createUnableDialog =
CreateUnableDialog.newInstance(state.data.message.orEmpty())
createUnableDialog?.show(supportFragmentManager, DIALOG_UNABLE)
}
createUnableDialog =
CreateUnableDialog.newInstance(state.data.message.orEmpty())
createUnableDialog?.show(supportFragmentManager, DIALOG_UNABLE)
}

is UiState.Failure -> toast(stringOf(R.string.error_msg))
Expand Down
4 changes: 3 additions & 1 deletion presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@
<string name="verify_exit_btn_exit">나가기</string>

<string name="unable_tv_title">현재 점검 중입니다!</string>
<string name="unable_btn_close">닫기</string>
<string name="unable_btn_close">확인</string>

<string name="pay_error_dialog_title">결제 오류</string>
<string name="pay_error_dialog_msg">오류로 인해 상품이 지급되지 않았어요. 고객센터로 문의 주시면 해결을 도와드리겠습니다.</string>
<string name="pay_error_dialog_btn">확인</string>

<string name="toast_service_finished">서비스가 종료되어 생성이 불가능해요.</string>

</resources>
Loading