mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-31 04:52:05 +00:00
Do not discard migrated profiles in TestFlight (#886)
Users would lose those profiles on downgrade to v2.
This commit is contained in:
parent
12b1784ac2
commit
e58726d0af
@ -40,6 +40,9 @@ struct MigrateView: View {
|
||||
@EnvironmentObject
|
||||
private var migrationManager: MigrationManager
|
||||
|
||||
@EnvironmentObject
|
||||
private var iapManager: IAPManager
|
||||
|
||||
@Environment(\.dismiss)
|
||||
private var dismiss
|
||||
|
||||
@ -187,12 +190,18 @@ private extension MigrateView {
|
||||
model.statuses[$0.id] == .done
|
||||
}
|
||||
pp_log(.App.migration, .notice, "Migrated \(migrated.count) profiles")
|
||||
do {
|
||||
try await migrationManager.deleteMigratableProfiles(withIds: Set(migrated.map(\.id)))
|
||||
pp_log(.App.migration, .notice, "Discarded \(migrated.count) migrated profiles from old store")
|
||||
} catch {
|
||||
pp_log(.App.migration, .error, "Unable to discard migrated profiles: \(error)")
|
||||
|
||||
if !iapManager.isRestricted {
|
||||
do {
|
||||
try await migrationManager.deleteMigratableProfiles(withIds: Set(migrated.map(\.id)))
|
||||
pp_log(.App.migration, .notice, "Discarded \(migrated.count) migrated profiles from old store")
|
||||
} catch {
|
||||
pp_log(.App.migration, .error, "Unable to discard migrated profiles: \(error)")
|
||||
}
|
||||
} else {
|
||||
pp_log(.App.migration, .notice, "Restricted build, do not discard migrated profiles")
|
||||
}
|
||||
|
||||
model.step = .migrated(migrated)
|
||||
} catch {
|
||||
pp_log(.App.migration, .error, "Unable to migrate profiles: \(error)")
|
||||
|
Loading…
Reference in New Issue
Block a user