Skip to content

Commit cea2d2d

Browse files
authored
default path was missing in save routine of settings view (#1016)
1 parent 1afd870 commit cea2d2d

2 files changed

Lines changed: 24 additions & 21 deletions

File tree

openHAB/SettingsView/MainUISettingsView.swift

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,31 @@ struct MainUISettingsView: View {
2828
}
2929

3030
LabeledContent {
31-
TextField(
32-
"/overview/",
33-
text: $settingsDefaultMainUIPath
34-
)
35-
.fixedSize()
36-
Button {
37-
showUselastPathAlert = true
38-
} label: {
39-
Image(systemSymbol: .plusCircle)
40-
}
41-
.confirmationDialog(
42-
"uselastpath_settings",
43-
isPresented: $showUselastPathAlert
44-
) {
45-
Button("Ok") {
46-
settingsDefaultMainUIPath = Preferences.shared.currentWebViewPath
31+
HStack {
32+
TextField(
33+
"/overview/",
34+
text: $settingsDefaultMainUIPath
35+
)
36+
.multilineTextAlignment(.trailing)
37+
Button {
38+
showUselastPathAlert = true
39+
} label: {
40+
Image(systemSymbol: .clear)
4741
}
48-
Button(role: .cancel) {} label: {
49-
Text(LocalizedStringKey("cancel"))
42+
.confirmationDialog(
43+
"uselastpath_settings",
44+
isPresented: $showUselastPathAlert
45+
) {
46+
Button("Ok") {
47+
settingsDefaultMainUIPath = Preferences.shared.currentWebViewPath
48+
}
49+
Button(role: .cancel) {} label: {
50+
Text(LocalizedStringKey("cancel"))
51+
}
52+
Button("cancel", role: .cancel) {}
53+
} message: {
54+
Text(LocalizedStringKey("uselastpath_settings"))
5055
}
51-
Button("cancel", role: .cancel) {}
52-
} message: {
53-
Text(LocalizedStringKey("uselastpath_settings"))
5456
}
5557

5658
} label: {

openHAB/SettingsView/SettingsView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ struct SettingsView: View {
141141
homePreferences.realTimeSliders = settingsRealTimeSliders
142142
homePreferences.iconType = settingsIconType.rawValue
143143
homePreferences.sortSitemapsBy = settingsSortSitemapsBy.rawValue
144+
homePreferences.defaultMainUIPath = settingsDefaultMainUIPath
144145
homePreferences.alwaysAllowWebRTC = settingsAlwaysAllowWebRTC
145146
homePreferences.sitemapForWatch = settingsSitemapForWatch
146147
homePreferences.sitemapForWatchLabel = sitemaps.first { $0.name == settingsSitemapForWatch }?.label ?? "unknown"

0 commit comments

Comments
 (0)