File tree Expand file tree Collapse file tree
data/src/main/java/com/moneymong/moneymong/data/repository/user
feature/sign/src/main/java/com/moneymong/moneymong/feature/sign Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import javax.inject.Inject
1010
1111class UserRepositoryImpl @Inject constructor(
1212 private val userRemoteDataSource : UserRemoteDataSource ,
13+ private val userLocalDataSource : UserLocalDataSource ,
1314 private val loginLocalDataSource : LoginLocalDataSource
14- private val userLocalDataSource : UserLocalDataSource
1515) : UserRepository {
1616
1717 override suspend fun getMyInfo (): Result <UserEntity > {
Original file line number Diff line number Diff line change @@ -33,12 +33,10 @@ fun SplashScreen(
3333 val state = viewModel.collectAsState().value
3434
3535 LaunchedEffect (key1 = state.isTokenValid) {
36- state.isTokenValid?.let { isValid ->
37- if (isValid) {
38- navigateToLedger()
39- } else {
40- navigateToLogin()
41- }
36+ if (state.isTokenValid) {
37+ navigateToLedger()
38+ } else {
39+ navigateToLogin()
4240 }
4341 }
4442
Original file line number Diff line number Diff line change @@ -4,5 +4,5 @@ import com.moneymong.moneymong.common.base.State
44
55data class SplashState (
66 val startAnimation : Boolean = false ,
7- val isTokenValid : Boolean? = null
7+ val isTokenValid : Boolean = false
88) : State
Original file line number Diff line number Diff line change @@ -5,9 +5,6 @@ import com.moneymong.moneymong.domain.usecase.login.TokenUseCase
55import com.moneymong.moneymong.feature.sign.sideeffect.SplashSideEffect
66import com.moneymong.moneymong.feature.sign.state.SplashState
77import dagger.hilt.android.lifecycle.HiltViewModel
8- import kotlinx.coroutines.CoroutineScope
9- import kotlinx.coroutines.Dispatchers
10- import kotlinx.coroutines.launch
118import org.orbitmvi.orbit.syntax.simple.intent
129import org.orbitmvi.orbit.syntax.simple.reduce
1310import javax.inject.Inject
@@ -30,23 +27,18 @@ class SplashViewModel @Inject constructor(
3027 fun checkTokenValidity () = intent {
3128 tokenUseCase.getAccessToken()
3229 .onSuccess {
33- if (it.isNotEmpty()) {
34- reduce {
35- state.copy(
36- isTokenValid = true
37- )
38- }
39- } else {
40- reduce {
41- state.copy(
42- isTokenValid = false
43- )
44- }
30+ reduce {
31+ state.copy(
32+ isTokenValid = true
33+ )
4534 }
4635 }
4736 .onFailure {
48- // TODO - 에러 화면
37+ reduce {
38+ state.copy(
39+ isTokenValid = false
40+ )
41+ }
4942 }
5043 }
51-
5244}
You can’t perform that action at this time.
0 commit comments