mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 02:01:56 +00:00
Merge pull request #1854 from Hafizzle/Hafiz/reminder-fixes
Reminders not showing fix
This commit is contained in:
commit
7b4100c32e
3 changed files with 7 additions and 1 deletions
|
|
@ -90,6 +90,11 @@ open class Task : RealmObject, BaseMainObject, Parcelable, BaseTask {
|
||||||
override var isDue: Boolean? = null
|
override var isDue: Boolean? = null
|
||||||
|
|
||||||
var nextDue: RealmList<Date>? = null
|
var nextDue: RealmList<Date>? = null
|
||||||
|
var updatedAt: Date? = null
|
||||||
|
val isUpdatedToday: Boolean
|
||||||
|
get() = ZonedDateTime.ofInstant(updatedAt?.toInstant(), ZoneId.systemDefault()).toLocalDate()
|
||||||
|
.equals(ZonedDateTime.now().withZoneSameLocal(ZoneId.systemDefault()).toLocalDate())
|
||||||
|
|
||||||
|
|
||||||
// Needed for offline creating/updating
|
// Needed for offline creating/updating
|
||||||
var isSaving: Boolean = false
|
var isSaving: Boolean = false
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class TaskReceiver : BroadcastReceiver() {
|
||||||
.firstElement()
|
.firstElement()
|
||||||
.subscribe(
|
.subscribe(
|
||||||
Consumer {
|
Consumer {
|
||||||
if (!it.isValid || it.completed) {
|
if (it.isUpdatedToday && it.completed) {
|
||||||
return@Consumer
|
return@Consumer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ class TaskSerializer : JsonSerializer<Task>, JsonDeserializer<Task> {
|
||||||
} catch (ignored: java.lang.UnsupportedOperationException) {}
|
} catch (ignored: java.lang.UnsupportedOperationException) {}
|
||||||
task.dateCreated = context.deserialize(obj.get("createdAt"), Date::class.java)
|
task.dateCreated = context.deserialize(obj.get("createdAt"), Date::class.java)
|
||||||
task.dueDate = context.deserialize(obj.get("date"), Date::class.java)
|
task.dueDate = context.deserialize(obj.get("date"), Date::class.java)
|
||||||
|
task.updatedAt = context.deserialize(obj.get("updatedAt"), Date::class.java)
|
||||||
task.startDate = context.deserialize(obj.get("startDate"), Date::class.java)
|
task.startDate = context.deserialize(obj.get("startDate"), Date::class.java)
|
||||||
task.isDue = obj.get("isDue")?.asBoolean
|
task.isDue = obj.get("isDue")?.asBoolean
|
||||||
if (obj.has("nextDue")) {
|
if (obj.has("nextDue")) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue