mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-09-13 13:21:50 +02:00
Add one time wipe of logs for iOS
This commit is contained in:
@@ -12,7 +12,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
// Override point for customization after application launch.
|
||||
|
||||
let configuration = Realm.Configuration(
|
||||
schemaVersion: 20,
|
||||
schemaVersion: 21,
|
||||
migrationBlock: { [weak self] migration, oldSchemaVersion in
|
||||
if (oldSchemaVersion < 1) {
|
||||
AbsLogger.info(message: "Realm schema version was \(oldSchemaVersion)")
|
||||
@@ -71,6 +71,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
newObject?["version"] = ""
|
||||
}
|
||||
}
|
||||
if (oldSchemaVersion < 21) {
|
||||
// One-time wipe of accumulated logs that were freezing the app on load/clear
|
||||
migration.deleteData(forType: LogEntry.className())
|
||||
}
|
||||
}
|
||||
)
|
||||
Realm.Configuration.defaultConfiguration = configuration
|
||||
|
||||
Reference in New Issue
Block a user