Skip to content

Commit

Permalink
fix(fix-portalmanager-issue): [portalmanager] fix ThrottleScheduler i…
Browse files Browse the repository at this point in the history
…ssue
  • Loading branch information
233mawile authored and 233mawile-rc committed Apr 1, 2022
1 parent ecfe154 commit f3e66e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ export class ThrottleScheduler implements Scheduler {
schedule(task: () => void) {
if (!this._timeoutID) {
this._timeoutID = window.setTimeout(() => {
this._lastTask!();

this._reset();
this._timeoutID = undefined;
this._lastTask?.();
});
}

Expand All @@ -19,10 +18,6 @@ export class ThrottleScheduler implements Scheduler {

clear() {
window.clearTimeout(this._timeoutID);
this._reset();
}

private _reset() {
this._lastTask = null;
this._timeoutID = undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion sync-github.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"latestCommitSHA": "b05e574c28e1879fb1190997f13848ed30042c11"
"latestCommitSHA": "2b2ac1d04488fab2bba55871f0474357d04d4064"
}

0 comments on commit f3e66e2

Please sign in to comment.