|
|
|
|
@ -321,8 +321,8 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat |
|
|
|
|
val computableResult = realm.createObject(ComputableResult::class.java) |
|
|
|
|
computableResult.session = this |
|
|
|
|
} // if a ComputableResult exists and the session is not completed, delete it |
|
|
|
|
else if (this.startDate == null || this.endDate == null) { |
|
|
|
|
this.computableResult?.deleteFromRealm() |
|
|
|
|
else if ((this.startDate == null || this.endDate == null) && this.computableResult != null && this.computableResult.isValid) { |
|
|
|
|
this.computableResult.deleteFromRealm() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Update the ComputableResult |
|
|
|
|
@ -441,9 +441,9 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat |
|
|
|
|
*/ |
|
|
|
|
fun restart() { |
|
|
|
|
realm.executeTransaction { |
|
|
|
|
// this.timeFrame?.paused = false |
|
|
|
|
this.pauseDate = null |
|
|
|
|
this.startDate = Date() // timeFrame?.setDate(Date(), null) |
|
|
|
|
this.startDate = Date() |
|
|
|
|
this.endDate = null |
|
|
|
|
this.breakDuration = 0L |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|