mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
bump to 25.04.2 and improved migration code
This commit is contained in:
@@ -371,13 +371,6 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
|
||||
/// Perform any required migrations for the app to function correctly.
|
||||
private func performMigrationsIfNecessary(from oldVersion: Version, to newVersion: Version) {
|
||||
// Migration for the old `hideTimelineMedia` flag.
|
||||
if let userDefaults = UserDefaults(suiteName: InfoPlistReader.main.appGroupIdentifier),
|
||||
let hideTimelineMedia = userDefaults.value(forKey: "hideTimelineMedia") as? Bool {
|
||||
appSettings.timelineMediaVisibility = hideTimelineMedia ? .never : .always
|
||||
userDefaults.removeObject(forKey: "hideTimelineMedia")
|
||||
}
|
||||
|
||||
guard oldVersion != newVersion else { return }
|
||||
|
||||
MXLog.info("The app was upgraded from \(oldVersion) to \(newVersion)")
|
||||
@@ -394,6 +387,15 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
Tracing.deleteLogFiles()
|
||||
MXLog.info("Migrating to v1.6.7, log files have been wiped")
|
||||
}
|
||||
|
||||
if oldVersion < Version(25, 4, 2) {
|
||||
MXLog.info("Migrating to v25.04.2, checking if hideTimelineMedia flag can be migrated to timelineMediaVisibility")
|
||||
// Migration for the old `hideTimelineMedia` flag.
|
||||
if let userDefaults = UserDefaults(suiteName: InfoPlistReader.main.appGroupIdentifier),
|
||||
let hideTimelineMedia = userDefaults.value(forKey: "hideTimelineMedia") as? Bool {
|
||||
appSettings.timelineMediaVisibility = hideTimelineMedia ? .never : .always
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Clears the keychain, app support directory etc ready for a fresh use.
|
||||
|
||||
Reference in New Issue
Block a user