Clean up Inbox on migration

This commit is contained in:
Davide De Rosa 2018-10-27 13:30:08 +02:00
parent 05d745ad6d
commit cda53bc4f1
1 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,7 @@ extension ConnectionService {
throw ApplicationError.migration throw ApplicationError.migration
} }
// replace migration logic here // put migration logic here
// TODO: remove this code after 1.0 release // TODO: remove this code after 1.0 release
let build = json["build"] as? Int ?? 0 let build = json["build"] as? Int ?? 0
if build <= 1084 { if build <= 1084 {
@ -55,6 +55,11 @@ extension ConnectionService {
try migrateHostProfileConfigurations() try migrateHostProfileConfigurations()
try migrateSplitProfileSerialization(&json) try migrateSplitProfileSerialization(&json)
} }
if build <= 1107 {
let fm = FileManager.default
let inbox = fm.userURL(for: .documentDirectory, appending: "Inbox")
try? fm.removeItem(at: inbox)
}
return try JSONSerialization.data(withJSONObject: json, options: []) return try JSONSerialization.data(withJSONObject: json, options: [])
} }