[iOS & Android] iOS 1.2.3 and Android 1.7.2
All checks were successful
OpenClimb Docker Deploy / build-and-push (push) Successful in 2m32s
All checks were successful
OpenClimb Docker Deploy / build-and-push (push) Successful in 2m32s
This commit is contained in:
@@ -474,11 +474,13 @@ struct Attempt: Identifiable, Codable, Hashable {
|
||||
let restTime: Int?
|
||||
let timestamp: Date
|
||||
let createdAt: Date
|
||||
let updatedAt: Date
|
||||
|
||||
init(
|
||||
sessionId: UUID, problemId: UUID, result: AttemptResult, highestHold: String? = nil,
|
||||
notes: String? = nil, duration: Int? = nil, restTime: Int? = nil, timestamp: Date = Date()
|
||||
) {
|
||||
let now = Date()
|
||||
self.id = UUID()
|
||||
self.sessionId = sessionId
|
||||
self.problemId = problemId
|
||||
@@ -488,7 +490,8 @@ struct Attempt: Identifiable, Codable, Hashable {
|
||||
self.duration = duration
|
||||
self.restTime = restTime
|
||||
self.timestamp = timestamp
|
||||
self.createdAt = Date()
|
||||
self.createdAt = now
|
||||
self.updatedAt = now
|
||||
}
|
||||
|
||||
func updated(
|
||||
@@ -506,13 +509,15 @@ struct Attempt: Identifiable, Codable, Hashable {
|
||||
duration: duration ?? self.duration,
|
||||
restTime: restTime ?? self.restTime,
|
||||
timestamp: self.timestamp,
|
||||
createdAt: self.createdAt
|
||||
createdAt: self.createdAt,
|
||||
updatedAt: Date()
|
||||
)
|
||||
}
|
||||
|
||||
private init(
|
||||
id: UUID, sessionId: UUID, problemId: UUID, result: AttemptResult, highestHold: String?,
|
||||
notes: String?, duration: Int?, restTime: Int?, timestamp: Date, createdAt: Date
|
||||
notes: String?, duration: Int?, restTime: Int?, timestamp: Date, createdAt: Date,
|
||||
updatedAt: Date
|
||||
) {
|
||||
self.id = id
|
||||
self.sessionId = sessionId
|
||||
@@ -524,11 +529,13 @@ struct Attempt: Identifiable, Codable, Hashable {
|
||||
self.restTime = restTime
|
||||
self.timestamp = timestamp
|
||||
self.createdAt = createdAt
|
||||
self.updatedAt = updatedAt
|
||||
}
|
||||
|
||||
static func fromImport(
|
||||
id: UUID, sessionId: UUID, problemId: UUID, result: AttemptResult, highestHold: String?,
|
||||
notes: String?, duration: Int?, restTime: Int?, timestamp: Date, createdAt: Date
|
||||
notes: String?, duration: Int?, restTime: Int?, timestamp: Date, createdAt: Date,
|
||||
updatedAt: Date
|
||||
) -> Attempt {
|
||||
return Attempt(
|
||||
id: id,
|
||||
@@ -540,7 +547,8 @@ struct Attempt: Identifiable, Codable, Hashable {
|
||||
duration: duration,
|
||||
restTime: restTime,
|
||||
timestamp: timestamp,
|
||||
createdAt: createdAt
|
||||
createdAt: createdAt,
|
||||
updatedAt: updatedAt
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user