Skip to content

Commit

Permalink
Match any destination for backup state
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Jul 12, 2022
1 parent 34681d5 commit 31ffdb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Pareto/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4856</string>
<string>4861</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
17 changes: 4 additions & 13 deletions Pareto/Models/TimeMachineBackup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 31ffdb8

Please sign in to comment.