Skip to content

Commit e3b189c

Browse files
committed
Re-determine lazy/state properties if a previous update timed out
1 parent ba3f606 commit e3b189c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

interfaces/src/main/kotlin/com/noxcrew/interfaces/properties/LazyProperty.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public abstract class LazyProperty<T : Any>(
9292
view,
9393
),
9494
) {
95+
// Make any failed reload of the value cause it to be refreshed again later!
96+
initialized = false
97+
9598
withTimeout(updateTimeout) {
9699
value = load(reload)
97100
if (triggeringUpdate) {

interfaces/src/main/kotlin/com/noxcrew/interfaces/properties/StateProperty.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public abstract class StateProperty(
6767
view,
6868
),
6969
) {
70+
// Make any failed reload of the value cause it to be refreshed again later!
71+
initialized = false
72+
7073
withTimeout(updateTimeout) {
7174
update()
7275

0 commit comments

Comments
 (0)