File tree Expand file tree Collapse file tree
domain/src/commonMain/kotlin/zed/rainxch/core/domain/model
presentation/src/commonMain/kotlin/zed/rainxch/core/presentation/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package zed.rainxch.core.domain.model
33import kotlin.time.Clock
44import kotlin.time.Duration
55import kotlin.time.Duration.Companion.seconds
6+ import kotlin.time.Instant
67
78data class RateLimitInfo (
89 val limit : Int ,
@@ -14,8 +15,8 @@ data class RateLimitInfo(
1415 get() = remaining == 0
1516
1617 fun timeUntilReset (): Duration {
17- val diff = resetTimestamp - Clock . System .now().toEpochMilliseconds( )
18- return diff.seconds .coerceAtLeast(Duration .ZERO )
18+ val reset = Instant .fromEpochSeconds(resetTimestamp )
19+ return (reset - Clock . System .now()) .coerceAtLeast(Duration .ZERO )
1920 }
2021
2122 fun isCurrentlyLimited (): Boolean {
Original file line number Diff line number Diff line change 11package zed.rainxch.core.presentation.utils
22
33import androidx.compose.runtime.Composable
4- import zed.rainxch.githubstore.core.presentation.res.*
54import kotlinx.datetime.TimeZone
65import kotlinx.datetime.toLocalDateTime
76import org.jetbrains.compose.resources.getString
87import org.jetbrains.compose.resources.stringResource
8+ import zed.rainxch.githubstore.core.presentation.res.*
99import kotlin.time.Clock
1010import kotlin.time.Duration
1111import kotlin.time.Duration.Companion.days
You can’t perform that action at this time.
0 commit comments