File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
data/core/src/main/java/com/yapp/ndgl/data/core/interceptor
feature/travel-helper/src/main/java/com/yapp/ndgl/feature/travelhelper/main Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ class AndroidCredentialInterceptor @Inject constructor(
3131 MessageDigest .getInstance(" SHA-1" )
3232 .digest(signatures?.getOrNull(0 )?.toByteArray())
3333 .joinToString(" " ) { " %02x" .format(it) }
34- } catch (e: Exception ) { " " }
34+ } catch (_: Exception ) {
35+ " "
36+ }
3537 }
3638}
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ import androidx.compose.ui.Alignment
3131import androidx.compose.ui.Modifier
3232import androidx.compose.ui.draw.clip
3333import androidx.compose.ui.graphics.vector.ImageVector
34- import androidx.compose.ui.platform.LocalContext
3534import androidx.compose.ui.res.painterResource
3635import androidx.compose.ui.res.stringResource
3736import androidx.compose.ui.res.vectorResource
@@ -56,8 +55,6 @@ internal fun TravelHelperRoute(
5655 navigateToPlaceDetail : (String ) -> Unit ,
5756 viewModel : TravelHelperViewModel = hiltViewModel(),
5857) {
59- val context = LocalContext .current
60-
6158 val state by viewModel.collectAsState()
6259 val snackbarHostState = remember { SnackbarHostState () }
6360 val coroutineScope = rememberCoroutineScope()
Original file line number Diff line number Diff line change @@ -180,22 +180,22 @@ class TravelHelperViewModel @Inject constructor(
180180 return when {
181181 to == " KRW" -> {
182182 exchangeRateRepository.getKrwRate(from)
183- ? : throw IllegalStateException (" Exchange rate not available for $from " )
183+ ? : error (" Exchange rate not available for $from " )
184184 }
185185
186186 from == " KRW" -> {
187187 val toKrw = exchangeRateRepository.getKrwRate(to)
188- ? : throw IllegalStateException (" Exchange rate not available for $to " )
189- if (toKrw == 0.0 ) throw IllegalStateException ( " KRW rate for $to is zero" )
188+ ? : error (" Exchange rate not available for $to " )
189+ check (toKrw != 0.0 ) { " KRW rate for $to is zero" }
190190 1.0 / toKrw
191191 }
192192
193193 else -> {
194194 val fromKrw = exchangeRateRepository.getKrwRate(from)
195- ? : throw IllegalStateException (" Exchange rate not available for $from " )
195+ ? : error (" Exchange rate not available for $from " )
196196 val toKrw = exchangeRateRepository.getKrwRate(to)
197- ? : throw IllegalStateException (" Exchange rate not available for $to " )
198- if (toKrw == 0.0 ) throw IllegalStateException ( " KRW rate for $to is zero" )
197+ ? : error (" Exchange rate not available for $to " )
198+ check (toKrw != 0.0 ) { " KRW rate for $to is zero" }
199199 fromKrw / toKrw
200200 }
201201 }
You can’t perform that action at this time.
0 commit comments