commit 97c1dc803ef0b1bee3209d537326e2b1ec7133dc parent 04ba925201b13c7bcac26717007428ffbaf5027f Author: Marc Stibane <marc@taler.net> Date: Wed, 11 Sep 2024 08:15:48 +0200 nonZeroBalances Diffstat:
| M | TalerWallet1/Model/Model+Balances.swift | | | 7 | +++++++ |
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/TalerWallet1/Model/Model+Balances.swift b/TalerWallet1/Model/Model+Balances.swift @@ -39,6 +39,13 @@ struct Balance: Decodable, Hashable, Sendable { hasher.combine(flags) } } +extension Balance { + static func nonZeroBalances(_ balances: [Balance]) -> [Balance] { + balances.filter { balance in + !balance.available.isZero + } + } +} // MARK: - /// A request to get the balances held in the wallet. fileprivate struct Balances: WalletBackendFormattedRequest {