@@ -125,7 +125,7 @@ class WalletOverviewViewModel(greenWallet: GreenWallet) :
125125
126126 override val isWalletOnboarding: StateFlow <Boolean > = combine(session.zeroAccounts, session.failedNetworks) { zeroAccounts, failedNetworks ->
127127 zeroAccounts && failedNetworks.isEmpty() && ! session.isWatchOnly
128- }.filter { session.isConnected }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), false )
128+ }.filter { session.isConnected }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), false )
129129
130130 override val assetIcons: StateFlow <List <String >> = session.walletAssets
131131 .filter { session.isConnected }.map {
@@ -136,11 +136,11 @@ class WalletOverviewViewModel(greenWallet: GreenWallet) :
136136 " unknown"
137137 }
138138 }.distinct()
139- }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), listOf ())
139+ }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), listOf ())
140140
141141 override val totalAssets: StateFlow <Int > = session.walletAssets.map {
142142 it.size
143- }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), 0 )
143+ }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), 0 )
144144
145145 private val _accountsBalance = combine(
146146 session.accounts,
@@ -152,7 +152,7 @@ class WalletOverviewViewModel(greenWallet: GreenWallet) :
152152 accounts.map {
153153 AccountBalance .create(account = it, session = session)
154154 }
155- }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), listOf ())
155+ }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), listOf ())
156156
157157 override val accounts: StateFlow <List <AccountBalance >> =
158158 combine(hideAmounts, _accountsBalance , session.expired2FA) { hideAmounts, accountsBalance, _ ->
@@ -161,13 +161,13 @@ class WalletOverviewViewModel(greenWallet: GreenWallet) :
161161 } else {
162162 accountsBalance
163163 }
164- }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), listOf ())
164+ }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), listOf ())
165165
166166 override val lightningInfo: StateFlow <LightningInfoLook ?> = (session.lightningSdkOrNull?.nodeInfoStateFlow?.map {
167167 if (session.isConnected && isLightningShortcut){
168168 LightningInfoLook .create(session = session, nodeState = it)
169169 } else null
170- } ? : emptyFlow()).stateIn(viewModelScope, SharingStarted .WhileSubscribed (), null )
170+ } ? : emptyFlow()).stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), null )
171171
172172
173173 private val _transactions : StateFlow <DataState <List <TransactionLook >>> = combine(
@@ -176,10 +176,10 @@ class WalletOverviewViewModel(greenWallet: GreenWallet) :
176176 ) { transactions, _ ->
177177 transactions.mapSuccess {
178178 it.map {
179- TransactionLook .create(it, session)
179+ TransactionLook .create(transaction = it, session = session, disableHideAmounts = true )
180180 }
181181 }
182- }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), DataState .Loading )
182+ }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), DataState .Loading )
183183
184184 // Re-calculate if needed (hideAmount or denomination & exchange rate change)
185185 override val transactions: StateFlow <DataState <List <TransactionLook >>> =
@@ -192,7 +192,7 @@ class WalletOverviewViewModel(greenWallet: GreenWallet) :
192192 } else {
193193 transactionsLooks
194194 }
195- }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), DataState .Loading )
195+ }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), DataState .Loading )
196196
197197 private val primaryBalanceInFiat: MutableStateFlow <Boolean > = MutableStateFlow (false )
198198
@@ -216,11 +216,11 @@ class WalletOverviewViewModel(greenWallet: GreenWallet) :
216216 lspHeath?.takeIf { it != HealthCheckStatus .OPERATIONAL }
217217 ?.let { AlertType .LspStatus (maintenance = it == HealthCheckStatus .MAINTENANCE ) },
218218 )
219- }.filter { session.isConnected }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), listOf ())
219+ }.filter { session.isConnected }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), listOf ())
220220
221221 override val archivedAccounts: StateFlow <Int > = session.allAccounts.map {
222222 it.filter { it.hidden }.size
223- }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), 0 )
223+ }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (5000L ), 0 )
224224
225225 override val isLightningShortcut
226226 get() = session.isLightningShortcut
0 commit comments