@@ -14,6 +14,7 @@ import kotlinx.coroutines.flow.update
1414import kotlinx.coroutines.launch
1515import kotlinx.datetime.Clock
1616import to.bitkit.data.SettingsStore
17+ import to.bitkit.data.dto.TransferType
1718import to.bitkit.models.Suggestion
1819import to.bitkit.models.WidgetType
1920import to.bitkit.models.toSuggestionOrNull
@@ -257,7 +258,8 @@ class HomeViewModel @Inject constructor(
257258 private fun createSuggestionsFlow () = combine(
258259 walletRepo.balanceState,
259260 settingsStore.data,
260- ) { balanceState, settings ->
261+ activityRepo.inProgressTransfers
262+ ) { balanceState, settings, transfers ->
261263 val baseSuggestions = when {
262264 balanceState.totalLightningSats > 0uL -> { // With Lightning
263265 listOfNotNull(
@@ -275,7 +277,9 @@ class HomeViewModel @Inject constructor(
275277 balanceState.totalOnchainSats > 0uL -> { // Only on chain balance
276278 listOfNotNull(
277279 Suggestion .BACK_UP .takeIf { ! settings.backupVerified },
278- Suggestion .SPEND , // TODO Replace with LIGHTNING_SETTING_UP when the spending balance is confirming
280+ Suggestion .SPEND .takeIf {
281+ ! transfers.any { it.type == TransferType .TO_SPENDING }
282+ } ? : Suggestion .LIGHTNING_SETTING_UP ,
279283 Suggestion .SECURE .takeIf { ! settings.isPinEnabled },
280284 Suggestion .BUY ,
281285 Suggestion .SUPPORT ,
0 commit comments