Skip to content

Commit

Permalink
[BE-ReactionWatchTask] Swap prev & latest pos to calcuating delta
Browse files Browse the repository at this point in the history
  • Loading branch information
occidere committed Oct 1, 2020
1 parent 4977ff5 commit 29d246c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/scala/org/occidere/githubwatcher/vo/ReactionDiff.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ package org.occidere.githubwatcher.vo
* @since 2020-09-23
*/
case class ReactionDiff(prevReaction: Reaction, latestReaction: Reaction) {
val thumbUpDelta: Int = prevReaction.thumbUp - latestReaction.thumbUp
val thumbDownDelta: Int = prevReaction.thumbDown - latestReaction.thumbDown
val laughDelta: Int = prevReaction.laugh - latestReaction.laugh
val hoorayDelta: Int = prevReaction.hooray - latestReaction.hooray
val heartDelta: Int = prevReaction.heart - latestReaction.heart
val rocketDelta: Int = prevReaction.rocket - latestReaction.rocket
val eyesDelta: Int = prevReaction.eyes - latestReaction.eyes
val confusedDelta: Int = prevReaction.confused - latestReaction.confused
val thumbUpDelta: Int = latestReaction.thumbUp - prevReaction.thumbUp
val thumbDownDelta: Int = latestReaction.thumbDown - prevReaction.thumbDown
val laughDelta: Int = latestReaction.laugh - prevReaction.laugh
val hoorayDelta: Int = latestReaction.hooray - prevReaction.hooray
val heartDelta: Int = latestReaction.heart - prevReaction.heart
val rocketDelta: Int = latestReaction.rocket - prevReaction.rocket
val eyesDelta: Int = latestReaction.eyes - prevReaction.eyes
val confusedDelta: Int = latestReaction.confused - prevReaction.confused

val hasChanged: Boolean = thumbUpDelta != 0 || thumbDownDelta != 0 || laughDelta != 0 ||
hoorayDelta != 0 || heartDelta != 0 || rocketDelta != 0 || eyesDelta != 0 || confusedDelta != 0
Expand Down

0 comments on commit 29d246c

Please sign in to comment.