From 176b0c14172eecc983ede4ee07331ffef6e367f0 Mon Sep 17 00:00:00 2001 From: Robert de Jong Date: Sun, 29 Sep 2024 12:08:40 +0200 Subject: [PATCH] Change function signature --- .../BasalProfileEditor/BasalProfileEditorStateModel.swift | 4 ++-- .../BasalProfileEditor/View/BasalProfileEditorRootView.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift b/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift index 1de0a86e8..b4a502b1d 100644 --- a/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift +++ b/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift @@ -86,9 +86,9 @@ extension BasalProfileEditor { } } - func availableTimeIndices(forItemIndex: Int) -> [Int] + func availableTimeIndices(_ itemIndex: Int) -> [Int] { - let usedIndicesByOtherItems = items.filter { $0 != items[forItemIndex] }.map(\.timeIndex) + let usedIndicesByOtherItems = items.filter { $0 != items[itemIndex] }.map(\.timeIndex) return (0 ..< timeValues.count).filter { !usedIndicesByOtherItems.contains($0) } } } diff --git a/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift b/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift index 9f83cfdfa..c2bbd0d95 100644 --- a/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift +++ b/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift @@ -85,7 +85,7 @@ extension BasalProfileEditor { .clipped() Picker(selection: $state.items[index].timeIndex, label: EmptyView()) { - ForEach(state.availableTimeIndices(forItemIndex: index), id: \.self) { i in + ForEach(state.availableTimeIndices(index), id: \.self) { i in Text( self.dateFormatter .string(from: Date(