Skip to content

Commit 10cbfdf

Browse files
committed
fix: magic number use in constant
1 parent c39ceb5 commit 10cbfdf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ import java.math.BigDecimal
155155
import javax.inject.Inject
156156
import kotlin.coroutines.cancellation.CancellationException
157157
import kotlin.time.Duration
158+
import kotlin.time.Duration.Companion.hours
158159
import kotlin.time.Duration.Companion.milliseconds
159160
import kotlin.time.Duration.Companion.minutes
160161
import kotlin.time.Duration.Companion.seconds
@@ -2094,7 +2095,7 @@ class AppViewModel @Inject constructor(
20942095
lightningRepo.createInvoiceMsats(
20952096
amountMsats = lnurl.data.maxWithdrawable,
20962097
description = lnurl.data.defaultDescription,
2097-
expirySeconds = 3_600u,
2098+
expirySeconds = LNURL_EXPIRY_SEC,
20982099
)
20992100
} else {
21002101
val withdrawAmountSats = _sendUiState.value.amount.coerceAtLeast(
@@ -2104,7 +2105,7 @@ class AppViewModel @Inject constructor(
21042105
lightningRepo.createInvoice(
21052106
amountSats = withdrawAmountSats,
21062107
description = lnurl.data.defaultDescription,
2107-
expirySeconds = 3_600u,
2108+
expirySeconds = LNURL_EXPIRY_SEC,
21082109
)
21092110
}.getOrNull()
21102111

@@ -2804,6 +2805,7 @@ class AppViewModel @Inject constructor(
28042805
private val PUBLIC_PAYKIT_SYNC_DEBOUNCE = 1.seconds
28052806
private val PUBLIC_PAYKIT_BOLT11_REFRESH_WINDOW = 30.minutes
28062807
private const val PUBKYAUTH_SCHEME = "pubkyauth"
2808+
private val LNURL_EXPIRY_SEC = 1.hours.inWholeSeconds.toUInt()
28072809
}
28082810
}
28092811

0 commit comments

Comments
 (0)