Fix compilation errors in ChartsViewModel and AllocationEvolutionChart

- Remove unnecessary optional binding for non-optional source.id
- Break up AllocationEvolutionChart body to help Swift type-checker

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
alexandrev-tibco
2026-02-12 00:04:52 +01:00
parent 151eb0e662
commit ace58e5b0f
2 changed files with 57 additions and 32 deletions
@@ -294,8 +294,7 @@ class ChartsViewModel: ObservableObject {
let sources: [InvestmentSource]
if !selectedSourceIds.isEmpty {
sources = sourceRepository.sources.filter { source in
guard let id = source.id else { return false }
return selectedSourceIds.contains(id) && shouldIncludeSource(source)
selectedSourceIds.contains(source.id) && shouldIncludeSource(source)
}
} else if let selectedSource {
sources = sourceRepository.sources.filter { $0.id == selectedSource.id && shouldIncludeSource($0) }