Cleanup code

This commit is contained in:
Kgothatso Ngako
2026-06-20 14:59:46 +02:00
parent 6c2609254d
commit 9def2cbe33
115 changed files with 371 additions and 416 deletions

View File

@@ -225,7 +225,7 @@ object BusinessManager {
nodeParamsManager.nodeParams.filterNotNull().first().nodeEvents
) { nextTimeout, nodeEvent ->
nextTimeout to nodeEvent
}.collect { (nextTimeout, event) ->
}.collect { (_, event) ->
// TODO: click on notif must deeplink to the notification screen
when (event) {
is LiquidityEvents.Rejected -> {
@@ -246,7 +246,7 @@ object BusinessManager {
internalPrefs.saveLastRejectedOnchainSwap(event)
}
}
val walletMetadata = globalPrefs.getAvailableWalletsMeta.first().getByWalletIdOrDefault(walletId)
globalPrefs.getAvailableWalletsMeta.first().getByWalletIdOrDefault(walletId)
when (val reason = event.reason) {
is LiquidityEvents.Rejected.Reason.PolicySetToDisabled -> {
// TODO: SystemNotificationHelper.notifyPaymentRejectedPolicyDisabled(appContext, walletId, walletMetadata, event.source, event.amount, nextTimeout?.second)

View File

@@ -41,7 +41,7 @@ import platform.posix.size_tVar
private val almostEmptyArrayPinned = ByteArray(1).pin()
@ExperimentalForeignApi
public fun ByteArray.safeRefTo(index: Int): CValuesRef<ByteVar> {
fun ByteArray.safeRefTo(index: Int): CValuesRef<ByteVar> {
if (index == size) return almostEmptyArrayPinned.addressOf(0)
return refTo(index)
}