Skip to content

Commit

Permalink
chore/#6: scope 함수 사용해보기..
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeeum committed Apr 18, 2024
1 parent 1fbcccd commit b5228b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions app/src/main/java/com/sopt/now/compose/LoginActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ fun isLoginAvailable(
val message = when {
userId != id || userPw != pw -> R.string.login_error
else -> {
val intent = Intent(context, MainActivity::class.java)
intent.putExtra("userId", userId).putExtra("userPw", userPw)
.putExtra("userNick", userNick)
val intent = Intent(context, MainActivity::class.java).apply {
putExtra("userId", userId)
putExtra("userPw", userPw)
putExtra("userNick", userNick)
}
context.startActivity(intent)
R.string.login_success
}
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/com/sopt/now/compose/SignUpActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ fun isSignUpAvailable(context: Context,id: String,pw: String,nick: String,etc: S
nick.isBlank() || nick.length != nick.trim().length -> R.string.sign_up_nick_error
etc.length !in 1..Int.MAX_VALUE -> R.string.sign_up_etc_error
else -> {
val intent = Intent(context, LoginActivity::class.java)
intent.putExtra("userId", id).putExtra("userPw", pw).putExtra("userNick", nick)
val intent = Intent(context, LoginActivity::class.java).apply{
putExtra("userId", id)
putExtra("userPw", pw)
putExtra("userNick", nick)
}
context.startActivity(intent)
R.string.sign_up_success
}
Expand Down

0 comments on commit b5228b0

Please sign in to comment.