Fix throttler calling an action twice
There is a bug in throttler where an action is called immediately and also again when the Timer expires despite only being scheduled once by call(). This commit resets the action to null once it is completed.
This commit is contained in:
parent
8a29d67096
commit
509487f789
@ -25,6 +25,7 @@ class Throttler {
|
|||||||
|
|
||||||
void _callAction() {
|
void _callAction() {
|
||||||
_action?.call(); // If we have an action queued up, complete it.
|
_action?.call(); // If we have an action queued up, complete it.
|
||||||
|
_action = null; // Once an action is called, do not call the same action again unless another action is queued.
|
||||||
_timer = null;
|
_timer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user