From 31ffdb87c5abcd4342fb150c78ef683a70b84f2b Mon Sep 17 00:00:00 2001 From: Janez Troha Date: Tue, 12 Jul 2022 09:44:49 +0200 Subject: [PATCH] Match any destination for backup state --- Pareto/Info.plist | 2 +- Pareto/Models/TimeMachineBackup.swift | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Pareto/Info.plist b/Pareto/Info.plist index e0655932..e82b3890 100644 --- a/Pareto/Info.plist +++ b/Pareto/Info.plist @@ -26,7 +26,7 @@ CFBundleVersion - 4856 + 4861 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/Pareto/Models/TimeMachineBackup.swift b/Pareto/Models/TimeMachineBackup.swift index 917df2d7..29bd8f7a 100644 --- a/Pareto/Models/TimeMachineBackup.swift +++ b/Pareto/Models/TimeMachineBackup.swift @@ -64,24 +64,15 @@ struct TimeMachineConfig { return false } - let lastBackupDestination = Destinations.filter { dests in - dests.DestinationID == LastDestinationID + return Destinations.contains { d in + d.isUpToDateBackup } - - return lastBackupDestination.first?.isUpToDateBackup ?? false } var isEncryptedBackup: Bool { - // no backup made yet - if LastDestinationID.isEmpty { - return false + return Destinations.allSatisfy { d in + d.isEncrypted } - - let lastBackupDestination = Destinations.filter { dests in - dests.DestinationID == LastDestinationID - } - - return lastBackupDestination.first?.isEncrypted ?? false } var canCheckIsEncryptedBackup: Bool {