본인인증 완료
- 앱 재시작 되도록 수정
This commit is contained in:
@@ -8,6 +8,7 @@ import android.view.View
|
||||
import android.webkit.URLUtil
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Toast
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import coil.load
|
||||
import coil.transform.CircleCropTransformation
|
||||
import com.google.gson.Gson
|
||||
@@ -34,8 +35,10 @@ import kr.co.vividnext.sodalive.mypage.profile.ProfileUpdateActivity
|
||||
import kr.co.vividnext.sodalive.mypage.service_center.ServiceCenterActivity
|
||||
import kr.co.vividnext.sodalive.settings.SettingsActivity
|
||||
import kr.co.vividnext.sodalive.settings.notification.MemberRole
|
||||
import kr.co.vividnext.sodalive.splash.SplashActivity
|
||||
import org.koin.android.ext.android.inject
|
||||
|
||||
@UnstableApi
|
||||
class MyPageFragment : BaseFragment<FragmentMyBinding>(FragmentMyBinding::inflate) {
|
||||
|
||||
private val viewModel: MyPageViewModel by inject()
|
||||
@@ -138,7 +141,20 @@ class MyPageFragment : BaseFragment<FragmentMyBinding>(FragmentMyBinding::inflat
|
||||
val bootpayResponse = Gson().fromJson(it, BootpayResponse::class.java)
|
||||
val request = AuthVerifyRequest(receiptId = bootpayResponse.data.receiptId)
|
||||
requireActivity().runOnUiThread {
|
||||
viewModel.authVerify(request)
|
||||
viewModel.authVerify(request) {
|
||||
startActivity(
|
||||
Intent(
|
||||
requireContext(),
|
||||
SplashActivity::class.java
|
||||
).apply {
|
||||
addFlags(
|
||||
Intent.FLAG_ACTIVITY_CLEAR_TASK or
|
||||
Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
)
|
||||
}
|
||||
)
|
||||
requireActivity().finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ class MyPageViewModel(
|
||||
)
|
||||
}
|
||||
|
||||
fun authVerify(request: AuthVerifyRequest) {
|
||||
fun authVerify(request: AuthVerifyRequest, onSuccess: () -> Unit) {
|
||||
if (!_isLoading.value!!) {
|
||||
_isLoading.value = true
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class MyPageViewModel(
|
||||
.subscribe(
|
||||
{
|
||||
if (it.success) {
|
||||
getUserInfo()
|
||||
onSuccess()
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
|
Reference in New Issue
Block a user