Skip to content

Commit 4a5061f

Browse files
committed
fix: warp get data in runCatching
1 parent 1cf5f37 commit 4a5061f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/main/java/to/bitkit/data/widgets/PriceService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class PriceService @Inject constructor(
3838
override val refreshInterval = 1.minutes
3939
private val sourceLabel = "Bitfinex.com"
4040

41-
override suspend fun fetchData(): Result<PriceDTO> {
41+
override suspend fun fetchData(): Result<PriceDTO> = runCatching {
4242
val period = widgetsStore.data.first().pricePreferences.period ?: GraphPeriod.ONE_DAY
43-
return fetchData(period)
43+
fetchData(period).getOrThrow()
4444
}
4545

4646
suspend fun fetchData(period: GraphPeriod): Result<PriceDTO> = runCatching {

0 commit comments

Comments
 (0)