Skip to content

Commit

Permalink
refactor: 깃허브 코드를 파싱하는 함수를 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdgh1592 committed Jul 27, 2023
1 parent 697be4c commit c2057ee
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ class LoginActivity : AppCompatActivity() {

override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
intent?.data?.getQueryParameter(GITHUB_CODE_PARAMETER)?.let(viewModel::saveGithubCode)
intent?.parseGithubCode()?.let(viewModel::saveGithubCode)
}

private fun Intent.parseGithubCode(): String? =
data?.getQueryParameter(GITHUB_CODE_PARAMETER)

companion object {
private const val GITHUB_CODE_PARAMETER = "code"
}
Expand Down

0 comments on commit c2057ee

Please sign in to comment.