Skip to content
Snippets Groups Projects
Commit 0c46cf27 authored by Matthias Urhahn's avatar Matthias Urhahn
Browse files

Fix build error due to protobuf value changing from int to long.

parent 10f21a90
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,8 @@ data class QRCodeVerifyResult(
val singedTraceLocation: SignedEventOuterClass.SignedEvent
) {
fun isBeforeStartTime(now: Instant): Boolean =
singedTraceLocation.event.start != 0 && singedTraceLocation.event.start > now.seconds
singedTraceLocation.event.start != 0L && singedTraceLocation.event.start > now.seconds
fun isAfterEndTime(now: Instant): Boolean =
singedTraceLocation.event.end != 0 && singedTraceLocation.event.end < now.seconds
singedTraceLocation.event.end != 0L && singedTraceLocation.event.end < now.seconds
}
......@@ -21,8 +21,8 @@ fun QRCodeVerifyResult.toVerifiedTraceLocation() =
with(singedTraceLocation.event) {
VerifiedTraceLocation(
guid = guid.toByteArray().toByteString().base64(),
start = start.instant(),
end = end.instant(),
start = start.toInstant(),
end = end.toInstant(),
description = description,
defaultCheckInLengthInMinutes = defaultCheckInLengthInMinutes
)
......@@ -31,5 +31,5 @@ fun QRCodeVerifyResult.toVerifiedTraceLocation() =
/**
* Converts time in seconds into [Instant]
*/
private fun Int.instant() =
if (this == 0) null else Instant.ofEpochMilli(TimeUnit.SECONDS.toMillis(toLong()))
private fun Long.toInstant() =
if (this == 0L) null else Instant.ofEpochMilli(TimeUnit.SECONDS.toMillis(this))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment