Skip to content

Commit 6301b30

Browse files
committed
Rename dialog pre-populated with current profile name
1 parent 7984ca7 commit 6301b30

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

2002/dev_2002.patch

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ index 0b4cb551..9d97f342 100644
5252
ForEach(pluginMenuItems.filter {$0.section == .configuration}) { item in
5353
item.view
5454
}
55-
Submodule LoopKit 8e58b7e..fee7323:
55+
Submodule LoopKit 8e58b7e..b13348b:
5656
diff --git a/LoopKit/LoopKit.xcodeproj/project.pbxproj b/LoopKit/LoopKit.xcodeproj/project.pbxproj
5757
index bfdc9db..7dded80 100644
5858
--- a/LoopKit/LoopKit.xcodeproj/project.pbxproj
@@ -1115,10 +1115,10 @@ index 0000000..d8d16ff
11151115
+}
11161116
diff --git a/LoopKit/LoopKitUI/Views/Settings Editors/RenameProfileEditor.swift b/LoopKit/LoopKitUI/Views/Settings Editors/RenameProfileEditor.swift
11171117
new file mode 100644
1118-
index 0000000..730dbe6
1118+
index 0000000..8fd2666
11191119
--- /dev/null
11201120
+++ b/LoopKit/LoopKitUI/Views/Settings Editors/RenameProfileEditor.swift
1121-
@@ -0,0 +1,84 @@
1121+
@@ -0,0 +1,92 @@
11221122
+//
11231123
+// RenameProfileEditor.swift
11241124
+// LoopKitUI
@@ -1149,6 +1149,9 @@ index 0000000..730dbe6
11491149
+ },
11501150
+ trailing: { renameButton }
11511151
+ )
1152+
+ .onAppear {
1153+
+ self.newProfileName = currentProfileName
1154+
+ }
11521155
+
11531156
+ TextField("Profile Name", text: $newProfileName)
11541157
+ .textFieldStyle(RoundedBorderTextFieldStyle())
@@ -1177,6 +1180,11 @@ index 0000000..730dbe6
11771180
+ Button(
11781181
+ action: {
11791182
+ withAnimation {
1183+
+ guard newProfileName != currentProfileName else {
1184+
+ self.isPresented = false
1185+
+ return
1186+
+ }
1187+
+
11801188
+ if viewModel.doesProfileExist(withName: self.newProfileName) {
11811189
+ self.showAlert = true
11821190
+ } else {

0 commit comments

Comments
 (0)