File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Source/Yasba/Views/Sieve Script Builder Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ struct SieveScriptBuilderView: View {
1111 @State private var libraryWidth : CGFloat = 320
1212 @State private var shouldPresentSheet = false
1313 @State private var renderedScriptText : String = " "
14+ @State private var shouldShowClearConfirmation = false
1415
1516 var body : some View {
1617 HSplitView {
@@ -23,7 +24,7 @@ struct SieveScriptBuilderView: View {
2324 renderedScriptText = model. render ( )
2425 shouldPresentSheet = true
2526 } , onNew: {
26- model . clear ( )
27+ shouldShowClearConfirmation = true
2728 } )
2829 . ignoresSafeArea ( )
2930
@@ -52,6 +53,14 @@ struct SieveScriptBuilderView: View {
5253 } content: {
5354 RenderedSieveScriptView ( scriptText: $renderedScriptText)
5455 }
56+ . alert ( " Clear Script? " , isPresented: $shouldShowClearConfirmation) {
57+ Button ( " Cancel " , role: . cancel) { }
58+ Button ( " Clear " , role: . destructive) {
59+ model. clear ( )
60+ }
61+ } message: {
62+ Text ( " This will remove all commands from the script. This action cannot be undone. " )
63+ }
5564 }
5665}
5766
You can’t perform that action at this time.
0 commit comments