Skip to content

Commit 8834c43

Browse files
committed
.
1 parent b19cb2b commit 8834c43

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

lara/views/tweaks/MiscView.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ struct MiscView: View {
110110
revert()
111111
}
112112
}
113-
ForEach(tweaks.indices, id: \.self) { sectionindex in
113+
ForEach(Array(tweaks.enumerated()), id: \.offset) { sectionindex, section in
114114
Section(header: HeaderLabel(text: section.name, icon: section.icon)) {
115-
ForEach(section.tweaks.indices, id: \.self) { tweakindex in
116-
if let tweakinfo = tweaks[sectionindex][tweakindex].info {
117-
PlainToggle(text: tweaks[sectionindex][tweakindex].name, infoType: .info, infoTitle: "Tweak infomation", infoMessage: tweakinfo, isOn: $tweaks[sectionindex][tweakindex].state.enabled)
118-
.disabled(tweaks[sectionindex][tweakindex].readfailed)
115+
ForEach(Array(section.tweaks.enumerated()), id: \.offset) { tweakindex, tweak in
116+
if let tweakinfo = tweak.info {
117+
PlainToggle(text: tweak.name, infoType: .info, infoTitle: "Tweak infomation", infoMessage: tweakinfo, isOn: $tweaks[sectionindex][tweakindex].state.enabled)
118+
.disabled(tweak.readfailed)
119119
} else {
120-
PlainToggle(text: tweaks[sectionindex][tweakindex].name, isOn: $tweaks[sectionindex][tweakindex].state.enabled)
121-
.disabled(tweaks[sectionindex][tweakindex].readfailed)
120+
PlainToggle(text: tweak.name, isOn: $tweaks[sectionindex][tweakindex].state.enabled)
121+
.disabled(tweak.readfailed)
122122
}
123123
}
124124
}
@@ -147,16 +147,16 @@ struct MiscView: View {
147147
tweak.state.og = value
148148
tweak.state.enabled = value
149149
} else if !(result.message == "key \(tweak.key) not found") {
150-
msg += "Failed to read \(tweak.path): \(result.message)\n"
150+
errormsg += "Failed to read \(tweak.path): \(result.message)\n"
151151
tweak.readfailed = true
152152
}
153153
}
154154
section.tweaks[tweakindex] = tweak
155155
}
156156
tweaks[sectionindex] = section
157157
}
158-
if msg != "" {
159-
Alertinator.shared.alert(title: "Failed to load tweaks!", body: "Some or all tweaks failed to load:\n\(msg)")
158+
if errormsg != "" {
159+
Alertinator.shared.alert(title: "Failed to load tweaks!", body: "Some or all tweaks failed to load:\n\(errormsg)")
160160
}
161161
}
162162

0 commit comments

Comments
 (0)