Skip to content

Commit 2b66880

Browse files
committed
[BOOK-74] chore: 토끼 리뷰 반영
1 parent 4ca046c commit 2b66880

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
android:supportsRtl="true"
1616
android:theme="@style/Theme.Booket"
1717
tools:targetApi="31"
18-
android:usesCleartextTraffic="true">
18+
android:networkSecurityConfig="@xml/network_security_config">
1919

2020
<provider
2121
android:name="androidx.startup.InitializationProvider"

core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface ErrorHandlerActions {
1414
fun handleException(exception: Throwable, actions: ErrorHandlerActions) {
1515
when (exception) {
1616
is HttpException -> {
17-
if (exception.code() in 500..511) {
17+
if (exception.code() in 500..599) {
1818
actions.setServerErrorDialogVisible(true)
1919
} else {
2020
exception.message?.let { Logger.e(it) }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<domain-config cleartextTrafficPermitted="true">
4+
<domain includeSubdomains="true">api.qweasdzxc.shop</domain>
5+
</domain-config>
6+
</network-security-config>

feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/LoginPresenter.kt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,20 @@ class LoginPresenter @AssistedInject constructor(
4747

4848
is LoginScreen.Event.Login -> {
4949
scope.launch {
50-
repository.login(event.accessToken)
51-
.onSuccess {
52-
// TODO Token 저장
53-
navigator.resetRoot(HomeScreen)
54-
}.onFailure { exception ->
55-
exception.message?.let { Logger.e(it) }
56-
sideEffect = exception.message?.let {
57-
LoginScreen.SideEffect.ShowToast(it)
50+
try {
51+
repository.login(event.accessToken)
52+
.onSuccess {
53+
// TODO Token 저장
54+
navigator.resetRoot(HomeScreen)
55+
}.onFailure { exception ->
56+
exception.message?.let { Logger.e(it) }
57+
sideEffect = exception.message?.let {
58+
LoginScreen.SideEffect.ShowToast(it)
59+
}
5860
}
59-
}
60-
isLoading = false
61+
} finally {
62+
isLoading = false
63+
}
6164
}
6265
}
6366
}

0 commit comments

Comments
 (0)