ios: gate the drawer's dev-reset closure — ungated devReset() broke the Release archive (#455)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 file changed,
+8
−4
ios/LChat/LChatApp.swift+8 −4
diff --git a/ios/LChat/LChatApp.swift b/ios/LChat/LChatApp.swift| index f929285..6e12925 100644 |
| --- a/ios/LChat/LChatApp.swift |
| +++ b/ios/LChat/LChatApp.swift |
| @@ -389,16 +389,20 @@ struct RootView: View { |
| showAdd = true |
| }, |
| onReset: { |
| - // Dev reset: wipe the stores, then fold the RUNNING app |
| - // back to first-run in place — an exit(0) here read as a |
| - // crash. Order matters: wipe first, then drop the |
| - // in-memory mirrors so nothing re-persists. |
| + // Dev reset (Debug builds only — the drawer's button is |
| + // #if DEBUG, and so is AppState.devReset; an ungated call |
| + // here broke the Release archive). Wipe the stores, then |
| + // fold the RUNNING app back to first-run in place — an |
| + // exit(0) here read as a crash. Order matters: wipe first, |
| + // then drop the in-memory mirrors so nothing re-persists. |
| + #if DEBUG |
| DevReset.wipeAll() |
| app.devReset() |
| signIn.refreshSession() |
| path = [] |
| nav.selectInstance(nil) |
| showServers = false |
| + #endif |
| } |
| ) |
| .offset(x: (progress - 1) * drawerWidth) |