Kaynağa Gözat

Rename variables, cleanup in NightscoutConfigState WIP

Deniz Cengiz 1 yıl önce
ebeveyn
işleme
f7437b18dc

+ 4 - 4
FreeAPS/Sources/Modules/NightscoutConfig/NightscoutConfigStateModel.swift

@@ -35,7 +35,7 @@ extension NightscoutConfig {
         @Published var allowAnnouncements: Bool = false
         @Published var allowAnnouncements: Bool = false
         @Published var isConnectedToNS: Bool = false
         @Published var isConnectedToNS: Bool = false
 
 
-        @Published var isProfileImportPresented: Bool = false
+        @Published var isImportResultReviewPresented: Bool = false
         @Published var importErrors: [String] = []
         @Published var importErrors: [String] = []
         @Published var importStatus: ImportStatus = .finished
         @Published var importStatus: ImportStatus = .finished
 
 
@@ -133,7 +133,7 @@ extension NightscoutConfig {
                     )
                     )
                 }
                 }
 
 
-                // determine whether fetches values are mmol/L or mg/dL values
+                // determine, i.e. guesstimate, whether fetched values are mmol/L or mg/dL values
                 let shouldConvertToMgdL = fetchedProfile.units.contains("mmol") || fetchedProfile.target_low
                 let shouldConvertToMgdL = fetchedProfile.units.contains("mmol") || fetchedProfile.target_low
                     .contains(where: { $0.value <= 39 }) || fetchedProfile.target_high.contains(where: { $0.value <= 39 })
                     .contains(where: { $0.value <= 39 }) || fetchedProfile.target_high.contains(where: { $0.value <= 39 })
 
 
@@ -292,8 +292,8 @@ extension NightscoutConfig {
             DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
             DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
                 // stop blur
                 // stop blur
                 self.importStatus = .finished
                 self.importStatus = .finished
-                // display next step
-                self.isProfileImportPresented = true
+                // display next import rewview step
+                self.isImportResultReviewPresented = true
             }
             }
         }
         }
 
 

+ 1 - 1
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConfigRootView.swift

@@ -184,7 +184,7 @@ extension NightscoutConfig {
                 //                )
                 //                )
                 //            }
                 //            }
             }
             }
-            .fullScreenCover(isPresented: $state.isProfileImportPresented, content: {
+            .fullScreenCover(isPresented: $state.isImportResultReviewPresented, content: {
                 NightscoutImportResultView(resolver: resolver, state: state)
                 NightscoutImportResultView(resolver: resolver, state: state)
             })
             })
             .sheet(isPresented: $shouldDisplayHint) {
             .sheet(isPresented: $shouldDisplayHint) {

+ 2 - 2
FreeAPS/Sources/Modules/NightscoutConfig/View/ProfileImport/NightscoutImportResultView.swift

@@ -121,7 +121,7 @@ struct NightscoutImportResultView: BaseView {
                 Section {
                 Section {
                     HStack {
                     HStack {
                         Button {
                         Button {
-                            state.isProfileImportPresented = false
+                            state.isImportResultReviewPresented = false
                         } label: {
                         } label: {
                             Text("Finish").font(.title3)
                             Text("Finish").font(.title3)
                         }
                         }
@@ -133,7 +133,7 @@ struct NightscoutImportResultView: BaseView {
             }
             }
             .toolbar(content: {
             .toolbar(content: {
                 ToolbarItem(placement: .topBarLeading) {
                 ToolbarItem(placement: .topBarLeading) {
-                    Button(action: { state.isProfileImportPresented = false }, label: {
+                    Button(action: { state.isImportResultReviewPresented = false }, label: {
                         Text("Cancel")
                         Text("Cancel")
                     })
                     })
                 }
                 }