state: delay state restoring after updating a widget to prevent edition errors in some cases (#556)

This commit is contained in:
bordun 2019-09-03 19:02:45 +02:00
parent 54403a7db8
commit 526c097e0e

View file

@ -21,6 +21,8 @@ var StateManager = class StateManager {
this.valueNewPropQueue = {}
this.queueCounter = 0
this.flushTimeout = null
}
get(filter) {
@ -230,7 +232,12 @@ var StateManager = class StateManager {
decrementQueue() {
this.queueCounter--
if (this.queueCounter == 0) this.flush()
if (this.queueCounter == 0) {
if (this.flushTimeout) clearTimeout(this.flushTimeout)
this.flushTimeout = setTimeout(()=>{
this.flush()
})
}
}
}