Skip to content

Commit b19cb2b

Browse files
committed
mb
1 parent ab8d553 commit b19cb2b

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

lara/views/tweaks/MiscView.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,27 @@ struct MiscView: View {
136136

137137
private func load() {
138138
checkplists()
139-
for (sectionindex, section) in tweaks.enumerated() {
140-
for (tweakindex, tweak) in section.tweaks.enumerated() {
139+
msg = ""
140+
for (sectionindex, sectionitem) in tweaks.enumerated() {
141+
var section = sectionitem
142+
for (tweakindex, tweakitem) in section.tweaks.enumerated() {
143+
var tweak = tweakitem
141144
if fm.fileExists(atPath: tweak.path) {
142145
let result = mgr.getplistvalue(path: tweak.path, key: tweak.key)
143146
if result.ok, let value = result.value as? Bool {
144147
tweak.state.og = value
145148
tweak.state.enabled = value
146149
} else if !(result.message == "key \(tweak.key) not found") {
147-
mgr.logmsg("Failed to read \(tweak.path): \(result.message)")
150+
msg += "Failed to read \(tweak.path): \(result.message)\n"
148151
tweak.readfailed = true
149-
} else {
150-
// this happens when the file doesnt exist or the doesnt exist which can happen if the tweak is disabled
151-
tweak.state.og = false
152-
tweak.state.enabled = false
153152
}
154153
}
154+
section.tweaks[tweakindex] = tweak
155155
}
156+
tweaks[sectionindex] = section
157+
}
158+
if msg != "" {
159+
Alertinator.shared.alert(title: "Failed to load tweaks!", body: "Some or all tweaks failed to load:\n\(msg)")
156160
}
157161
}
158162

0 commit comments

Comments
 (0)