File tree Expand file tree Collapse file tree 4 files changed +21
-12
lines changed
common/src/main/kotlin/com/ninecraft/booket/core/common/utils
designsystem/src/main/res/xml
feature/login/src/main/kotlin/com/ninecraft/booket/feature/login Expand file tree Collapse file tree 4 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ interface ErrorHandlerActions {
1414fun 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) }
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments