Skip to content

Commit 03fcec5

Browse files
committed
Add debug buttons
1 parent 8ba71c5 commit 03fcec5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Core/Sources/HostApp/DebugView.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ struct DebugSettingsView: View {
5858
Toggle(isOn: $settings.useUserDefaultsBaseAPIKeychain) {
5959
Text("Store API keys in UserDefaults")
6060
}
61+
62+
Button("Reset Migration Version to 0") {
63+
UserDefaults.shared.set(nil, forKey: "OldMigrationVersion")
64+
}
65+
66+
Button("Reset 0.23.0 migration") {
67+
UserDefaults.shared.set("239", forKey: "OldMigrationVersion")
68+
UserDefaults.shared.set(nil, forKey: "MigrateTo240Finished")
69+
UserDefaults.shared.set(nil, forKey: "ChatModels")
70+
UserDefaults.shared.set(nil, forKey: "EmbeddingModels")
71+
}
6172
}
6273
}
6374
.padding()

Core/Sources/ServiceUpdateMigration/ServiceUpdateMigrator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct ServiceUpdateMigrator {
2222
}
2323

2424
func migrate(from oldVersion: String, to currentVersion: String) async throws {
25-
guard let old = Int(oldVersion) else { return }
25+
guard let old = Int(oldVersion), old != 0 else { return }
2626
if old <= 135 {
2727
try migrateFromLowerThanOrEqualToVersion135()
2828
}

0 commit comments

Comments
 (0)