Skip to content

Commit

Permalink
fix crash of app in macOS 15
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepistrol committed Sep 26, 2024
1 parent caf8a3a commit 440157c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion TimeMachineStatus/Extensions/Color+RawRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import SwiftUI

extension Color: RawRepresentable {
extension Color: @retroactive RawRepresentable {

Check failure on line 14 in TimeMachineStatus/Extensions/Color+RawRepresentable.swift

View workflow job for this annotation

GitHub Actions / Build

unknown attribute 'retroactive'

Check failure on line 14 in TimeMachineStatus/Extensions/Color+RawRepresentable.swift

View workflow job for this annotation

GitHub Actions / Build

inheritance from non-protocol type 'any RawRepresentable'
public init?(rawValue: String) {
guard let data = Data(base64Encoded: rawValue) else {
self = .black
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ extension BackupState {

required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let stateChangeString = try container.decode(String.self, forKey: .stateChange)
self.stateChange = if let date = _dateFormatter.date(from: stateChangeString) {
date
if let stateChangeString = try container.decodeIfPresent(String.self, forKey: .stateChange) {
self.stateChange = if let date = _dateFormatter.date(from: stateChangeString) {
date
} else {
throw BackupStateError.couldNotConvertStringToDate(string: stateChangeString)
}
} else {
throw BackupStateError.couldNotConvertStringToDate(string: stateChangeString)
self.stateChange = nil
}
self.destinationMountPoint = try container.decode(String.self, forKey: .destinationMountPoint)
try super.init(from: decoder)
}

let stateChange: Date
let stateChange: Date?
let destinationMountPoint: String
}
}
3 changes: 2 additions & 1 deletion TimeMachineStatus/Model/BackupState/Internal/_State.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ extension BackupState {
return ._finishing
case "Stopping":
return ._stopping
case "ThinningPostBackup":
case "ThinningPostBackup", "LazyThinning":
return ._thinning
default:
log.error("Unknown phase: \(phase)")
fatalError("Unknown phase: \(phase)")
}
} else {
Expand Down

0 comments on commit 440157c

Please sign in to comment.