Browse Source

Comment out but keep `resetLoopDocuments()`

Deniz Cengiz 1 year ago
parent
commit
3ac4c31767

+ 16 - 13
FreeAPS/Sources/Modules/Settings/SettingsStateModel.swift

@@ -62,19 +62,22 @@ extension Settings {
         func hideSettingsModal() {
         func hideSettingsModal() {
             hideModal()
             hideModal()
         }
         }
-
-        func resetLoopDocuments() {
-            guard let localDocuments = try? FileManager.default.url(
-                for: .documentDirectory,
-                in: .userDomainMask,
-                appropriateFor: nil,
-                create: true
-            ) else {
-                preconditionFailure("Could not get a documents directory URL.")
-            }
-            let storageURL = localDocuments.appendingPathComponent("PumpManagerState" + ".plist")
-            try? FileManager.default.removeItem(at: storageURL)
-        }
+// Commenting this out for now, as not needed and possibly dangerous for users to be able to nuke their pump pairing informations via the debug menu
+// Leaving it in here, as it may be a handy functionality for further testing or developers.
+// See https://github.com/nightscout/Trio/pull/277 for more information
+//
+//        func resetLoopDocuments() {
+//            guard let localDocuments = try? FileManager.default.url(
+//                for: .documentDirectory,
+//                in: .userDomainMask,
+//                appropriateFor: nil,
+//                create: true
+//            ) else {
+//                preconditionFailure("Could not get a documents directory URL.")
+//            }
+//            let storageURL = localDocuments.appendingPathComponent("PumpManagerState" + ".plist")
+//            try? FileManager.default.removeItem(at: storageURL)
+//        }
     }
     }
 }
 }
 
 

+ 10 - 6
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -61,12 +61,16 @@ extension Settings {
                                     .frame(maxWidth: .infinity, alignment: .trailing)
                                     .frame(maxWidth: .infinity, alignment: .trailing)
                                     .buttonStyle(.borderedProminent)
                                     .buttonStyle(.borderedProminent)
                             }
                             }
-                            HStack {
-                                Text("Delete Pump State nlist")
-                                Button("Delete") { state.resetLoopDocuments() }
-                                    .frame(maxWidth: .infinity, alignment: .trailing)
-                                    .buttonStyle(.borderedProminent)
-                            }
+// Commenting this out for now, as not needed and possibly dangerous for users to be able to nuke their pump pairing informations via the debug menu
+// Leaving it in here, as it may be a handy functionality for further testing or developers.
+// See https://github.com/nightscout/Trio/pull/277 for more information
+//
+//                            HStack {
+//                                Text("Delete Stored Pump State Binary Files")
+//                                Button("Delete") { state.resetLoopDocuments() }
+//                                    .frame(maxWidth: .infinity, alignment: .trailing)
+//                                    .buttonStyle(.borderedProminent)
+//                            }
                         }
                         }
                         Group {
                         Group {
                             Text("Preferences")
                             Text("Preferences")