@@ -62,6 +62,7 @@ class AuthViewModel @Inject constructor(
62
62
remoteConfigRepository.fetchFromRemoteConfig(RemoteConfigKey .MARKETING_SERVICE_TERM ),
63
63
),
64
64
)
65
+ private var appVersionName: String = " "
65
66
66
67
private val loginStateP: MutableLiveData <LoginState > = MutableLiveData ()
67
68
val loginState: LiveData <LoginState > = loginStateP
@@ -94,10 +95,8 @@ class AuthViewModel @Inject constructor(
94
95
}
95
96
}
96
97
97
- private fun handleOnActivityCreated (versionName : String ) = intent {
98
- reduce {
99
- state.copy(versionName = versionName)
100
- }
98
+ private fun handleOnActivityCreated (versionName : String ) {
99
+ appVersionName = versionName
101
100
}
102
101
103
102
private fun loginWithKakao (kakaoAuthToken : KakaoAuthToken ) = intent {
@@ -107,7 +106,7 @@ class AuthViewModel @Inject constructor(
107
106
SignIn (
108
107
accessToken = kakaoAuthToken.accessToken,
109
108
socialType = kakaoAuthToken.socialType,
110
- versionName = state.versionName ,
109
+ versionName = appVersionName ,
111
110
),
112
111
).onSuccess {
113
112
if (it == LoginState .LOGIN_SUCCESS ) {
@@ -126,9 +125,9 @@ class AuthViewModel @Inject constructor(
126
125
}
127
126
}
128
127
129
- private fun autoLogin () = intent {
128
+ private fun autoLogin () {
130
129
viewModelScope.launch {
131
- autoLoginUseCase(state.versionName ).let {
130
+ autoLoginUseCase(appVersionName ).let {
132
131
loginStateP.postValue(it)
133
132
}
134
133
}
@@ -153,7 +152,7 @@ class AuthViewModel @Inject constructor(
153
152
),
154
153
profileUrl = state.imageUrl,
155
154
introduction = state.introduction,
156
- versionName = state.versionName ,
155
+ versionName = appVersionName ,
157
156
),
158
157
)
159
158
0 commit comments