Fixed that BankListItem and BankAccountListItem didn't get updated on changes like balance changed or retrieved bank icon
This commit is contained in:
parent
f03480945e
commit
e8aee07b34
|
@ -70,6 +70,19 @@ extension KeychainPasswordItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extension IBankData {
|
||||||
|
|
||||||
|
var randomId: UUID { UUID() }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extension IBankAccount {
|
||||||
|
|
||||||
|
var randomId: UUID { UUID() }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extension BankData : Identifiable {
|
extension BankData : Identifiable {
|
||||||
|
|
||||||
public var id: String { technicalId }
|
public var id: String { technicalId }
|
||||||
|
|
|
@ -22,7 +22,8 @@ struct AccountsDialog: View {
|
||||||
Form {
|
Form {
|
||||||
AllBanksListItem(banks: data.banks)
|
AllBanksListItem(banks: data.banks)
|
||||||
|
|
||||||
ForEach(data.banks.sortedByDisplayIndex(), id: \.technicalId) { bank in
|
// if a constant id like \.technicalId is provided, list doesn't get updated on changes like balance changed or retrieved bank icon
|
||||||
|
ForEach(data.banksSorted, id: \.randomId) { bank in
|
||||||
BankListItem(bank: bank)
|
BankListItem(bank: bank)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,8 @@ struct BankListItem : View {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ForEach(bank.accountsSorted, id: \.technicalId) { account in
|
// if a constant id like \.technicalId is provided, list doesn't get updated on changes e.g. when balance changes
|
||||||
|
ForEach(bank.accountsSorted, id: \.randomId) { account in
|
||||||
BankAccountListItem(account: account)
|
BankAccountListItem(account: account)
|
||||||
}
|
}
|
||||||
.padding(.leading, Styles.AccountsIconWidth + Styles.DefaultSpaceBetweenIconAndText)
|
.padding(.leading, Styles.AccountsIconWidth + Styles.DefaultSpaceBetweenIconAndText)
|
||||||
|
|
Loading…
Reference in New Issue