Sfoglia il codice sorgente

Setting 'displayPresets' properly hides presets #212

Deniz Cengiz 1 anno fa
parent
commit
c4d2279685

+ 11 - 9
FreeAPS/Sources/Modules/Treatments/View/TreatmentsRootView.swift

@@ -316,15 +316,17 @@ extension Treatments {
                         Text("Close")
                     }
                 }
-                ToolbarItem(placement: .topBarTrailing) {
-                    Button(action: {
-                        showPresetSheet = true
-                    }, label: {
-                        HStack {
-                            Text("Presets")
-                            Image(systemName: "plus")
-                        }
-                    })
+                if state.displayPresets {
+                    ToolbarItem(placement: .topBarTrailing) {
+                        Button(action: {
+                            showPresetSheet = true
+                        }, label: {
+                            HStack {
+                                Text("Presets")
+                                Image(systemName: "pslus")
+                            }
+                        })
+                    }
                 }
             })
             .onAppear {