File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments