mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-09-13 05:11:56 +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.
|
// Override point for customization after application launch.
|
||||||
|
|
||||||
let configuration = Realm.Configuration(
|
let configuration = Realm.Configuration(
|
||||||
schemaVersion: 20,
|
schemaVersion: 21,
|
||||||
migrationBlock: { [weak self] migration, oldSchemaVersion in
|
migrationBlock: { [weak self] migration, oldSchemaVersion in
|
||||||
if (oldSchemaVersion < 1) {
|
if (oldSchemaVersion < 1) {
|
||||||
AbsLogger.info(message: "Realm schema version was \(oldSchemaVersion)")
|
AbsLogger.info(message: "Realm schema version was \(oldSchemaVersion)")
|
||||||
@@ -71,6 +71,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
newObject?["version"] = ""
|
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
|
Realm.Configuration.defaultConfiguration = configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user