Reviewed-on: https://codeberg.org/jlmakiola/calendula/pulls/206
This commit is contained in:
@@ -78,9 +78,15 @@ class EventDetailViewModel @Inject constructor(
|
||||
* the occurrence's own times (from `CalendarContract.Instances`); they
|
||||
* override the series DTSTART/DTEND so recurring events show the correct
|
||||
* date instead of the first occurrence.
|
||||
*
|
||||
* Re-opening the *same* occurrence always re-reads it. The view model
|
||||
* outlives the sheet, and a `StateFlow` conflates an identical value away,
|
||||
* so assigning the target alone would leave an edit that changed no time —
|
||||
* adding a description, say (#196) — showing the state from before the save.
|
||||
*/
|
||||
fun open(eventId: Long, beginMillis: Long, endMillis: Long) {
|
||||
_target.value = Target(eventId, beginMillis, endMillis)
|
||||
val target = Target(eventId, beginMillis, endMillis)
|
||||
if (_target.value == target) _reload.value += 1 else _target.value = target
|
||||
}
|
||||
|
||||
/** Re-run the current load after a failure. */
|
||||
|
||||
Reference in New Issue
Block a user