Skip to content

Commit

Permalink
[IDLE-511] 센터 관리자 인증 상태에서 앱 재실행시 인증 대기 화면으로 가지 않던 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Nov 11, 2024
1 parent ac24ec9 commit 536511d
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.idle.presentation

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.idle.analytics.error.ErrorLoggingHelper
Expand All @@ -14,8 +15,6 @@ import com.idle.domain.model.error.HttpResponseException
import com.idle.domain.model.profile.CenterManagerAccountStatus
import com.idle.domain.usecase.auth.GetAccessTokenUseCase
import com.idle.domain.usecase.auth.GetUserTypeUseCase
import com.idle.domain.usecase.chatting.ConnectWebSocketUseCase
import com.idle.domain.usecase.chatting.DisconnectWebSocketUseCase
import com.idle.domain.usecase.config.GetForceUpdateInfoUseCase
import com.idle.domain.usecase.profile.GetCenterStatusUseCase
import com.idle.domain.usecase.profile.GetMyCenterProfileUseCase
Expand Down Expand Up @@ -96,12 +95,8 @@ class MainViewModel @Inject constructor(
return@launch
}

when (userRole) {
UserType.CENTER.apiValue -> getMyCenterProfileUseCase().onFailure {
return@launch
}

UserType.WORKER.apiValue -> getMyWorkerProfileUseCase().onFailure {
if (userRole == UserType.WORKER.apiValue) {
getMyWorkerProfileUseCase().onFailure {
return@launch
}
}
Expand Down Expand Up @@ -132,6 +127,8 @@ class MainViewModel @Inject constructor(
}

private fun handleCenterStatus(status: CenterManagerAccountStatus) {
Log.d("test", status.toString())

when (status) {
CenterManagerAccountStatus.APPROVED -> handleApprovedCenterStatus()
else -> navigationHelper.navigateTo(
Expand Down

0 comments on commit 536511d

Please sign in to comment.