Skip to content

Commit

Permalink
[chore] : toast 매세지 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
chanubc committed Jan 2, 2024
1 parent 1ca2f3a commit 81a13ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ class DoAndroidFragment : Fragment() {
Toast.makeText(requireContext(), "서버 연결실패", Toast.LENGTH_SHORT).show()
}

is UiState.Loading -> {}
is UiState.Loading -> Toast.makeText(
requireContext(),
"로딩 중",
Toast.LENGTH_SHORT,
).show()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.launch
import org.sopt.dosopttemplate.databinding.ActivityLoginBinding
import org.sopt.dosopttemplate.ui.HomeActivity
import org.sopt.dosopttemplate.utils.UiState
import org.sopt.dosopttemplate.utils.ViewModelFactory
import org.sopt.dosopttemplate.utils.toast

Expand Down Expand Up @@ -57,13 +58,13 @@ class LoginActivity : AppCompatActivity() {
lifecycleScope.launch {
authViewModel.loginState.collect { loginState ->
when (loginState) {
is LoginState.Success -> {
is UiState.Success -> {
toast("로그인 성공")
startActivity(Intent(this@LoginActivity, HomeActivity::class.java))
}

is LoginState.Error -> toast("로그인 실패")
is LoginState.Loading -> toast("로그인 중")
is UiState.Error -> toast("로그인 실패")
is UiState.Loading -> {}
}
}
}
Expand Down

0 comments on commit 81a13ee

Please sign in to comment.