فهرست منبع

Remove parameter in onChange closure (deprecated in iOS 17)

polscm32 aka Marvout 1 سال پیش
والد
کامیت
ebe1ebf6f4
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 1 1
      FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift
  2. 3 3
      FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

+ 1 - 1
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -222,7 +222,7 @@ extension MainChartView {
             .onChange(of: state.insulinFromPersistence) {
             .onChange(of: state.insulinFromPersistence) {
                 state.roundedTotalBolus = state.calculateTINS()
                 state.roundedTotalBolus = state.calculateTINS()
             }
             }
-            .onChange(of: tempTargets) { _ in
+            .onChange(of: tempTargets) {
                 Task {
                 Task {
                     await calculateTempTargets()
                     await calculateTempTargets()
                 }
                 }

+ 3 - 3
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -480,7 +480,7 @@ extension Home {
                                 NSLocalizedString(" U", comment: "Unit in number of units delivered (keep the space character!)")
                                 NSLocalizedString(" U", comment: "Unit in number of units delivered (keep the space character!)")
                         )
                         )
                         .font(.system(size: 16, weight: .bold, design: .rounded))
                         .font(.system(size: 16, weight: .bold, design: .rounded))
-                        .onChange(of: state.hours) { _ in
+                        .onChange(of: state.hours) {
                             state.roundedTotalBolus = state.calculateTINS()
                             state.roundedTotalBolus = state.calculateTINS()
                         }
                         }
                         .onAppear {
                         .onAppear {
@@ -722,7 +722,7 @@ extension Home {
                 }
                 }
                 .background(color)
                 .background(color)
             }
             }
-            .onChange(of: state.hours) { _ in
+            .onChange(of: state.hours) {
                 highlightButtons()
                 highlightButtons()
             }
             }
             .onAppear {
             .onAppear {
@@ -892,7 +892,7 @@ extension Home {
                     }
                     }
                 )
                 )
             }.ignoresSafeArea(.keyboard, edges: .bottom).blur(radius: state.waitForSuggestion ? 8 : 0)
             }.ignoresSafeArea(.keyboard, edges: .bottom).blur(radius: state.waitForSuggestion ? 8 : 0)
-                .onChange(of: selectedTab) { _ in
+                .onChange(of: selectedTab) {
                     print("current path is empty: \(settingsPath.isEmpty)")
                     print("current path is empty: \(settingsPath.isEmpty)")
                     settingsPath = NavigationPath()
                     settingsPath = NavigationPath()
                 }
                 }