Remove dead code, and organize some live code
This commit is contained in:
parent
00378ea208
commit
e4f5e48ac9
@ -93,15 +93,6 @@ class ExperienceUpgradeManager: NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
/// Snoozes the given upgrade, and dismisses it if currently presented.
|
||||
static func snoozeExperienceUpgrade(_ manifest: ExperienceUpgradeManifest, transaction: GRDBWriteTransaction) {
|
||||
ExperienceUpgradeFinder.markAsSnoozed(experienceUpgradeManifest: manifest, transaction: transaction)
|
||||
|
||||
transaction.addAsyncCompletion(queue: .main) {
|
||||
dismissLastPresented(ifMatching: manifest)
|
||||
}
|
||||
}
|
||||
|
||||
private static func dismissLastPresented(ifMatching manifest: ExperienceUpgradeManifest? = nil) {
|
||||
guard let lastPresented = lastPresented else {
|
||||
return
|
||||
|
||||
@ -31,16 +31,6 @@ public class ExperienceUpgradeFinder: NSObject {
|
||||
experienceUpgrade.markAsViewed(transaction: transaction.asAnyWrite)
|
||||
}
|
||||
|
||||
public class func markAsSnoozed(
|
||||
experienceUpgradeManifest: ExperienceUpgradeManifest,
|
||||
transaction: GRDBWriteTransaction
|
||||
) {
|
||||
markAsSnoozed(
|
||||
experienceUpgrade: ExperienceUpgrade.makeNew(withManifest: experienceUpgradeManifest),
|
||||
transaction: transaction
|
||||
)
|
||||
}
|
||||
|
||||
public class func markAsSnoozed(experienceUpgrade: ExperienceUpgrade, transaction: GRDBWriteTransaction) {
|
||||
Logger.info("marking experience upgrade as snoozed \(experienceUpgrade.uniqueId)")
|
||||
|
||||
|
||||
@ -406,6 +406,8 @@ extension ExperienceUpgradeManifest {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Local megaphone preconditions
|
||||
|
||||
private static func checkPreconditionsForIntroducingPins(transaction: SDSAnyReadTransaction) -> Bool {
|
||||
// The PIN setup flow requires an internet connection and you to not already have a PIN
|
||||
if
|
||||
@ -444,6 +446,16 @@ extension ExperienceUpgradeManifest {
|
||||
}
|
||||
}
|
||||
|
||||
private static func checkPreconditionsForPinReminder(transaction: SDSAnyReadTransaction) -> Bool {
|
||||
return OWS2FAManager.shared.isDueForV2Reminder(transaction: transaction)
|
||||
}
|
||||
|
||||
private static func checkPreconditionsForContactsPermissionReminder() -> Bool {
|
||||
return CNContactStore.authorizationStatus(for: CNEntityType.contacts) != .authorized
|
||||
}
|
||||
|
||||
// MARK: Remote megaphone preconditions
|
||||
|
||||
private static func checkPreconditionsForRemoteMegaphone(_ megaphone: RemoteMegaphoneModel) -> Bool {
|
||||
guard
|
||||
AppVersion.compare(
|
||||
@ -503,12 +515,4 @@ extension ExperienceUpgradeManifest {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
private static func checkPreconditionsForPinReminder(transaction: SDSAnyReadTransaction) -> Bool {
|
||||
return OWS2FAManager.shared.isDueForV2Reminder(transaction: transaction)
|
||||
}
|
||||
|
||||
private static func checkPreconditionsForContactsPermissionReminder() -> Bool {
|
||||
return CNContactStore.authorizationStatus(for: CNEntityType.contacts) != .authorized
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user