From f3e66e22e4ef1dbfde86cbbf7a6fc570d73a895c Mon Sep 17 00:00:00 2001 From: 233mawile <903945079@qq.com> Date: Fri, 1 Apr 2022 19:02:36 +0800 Subject: [PATCH] fix(fix-portalmanager-issue): [portalmanager] fix ThrottleScheduler issue --- .../PortalHost/Connectable/ThrottleScheduler.ts | 9 ++------- sync-github.json | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/juno-core/src/components/PortalHost/Connectable/ThrottleScheduler.ts b/packages/juno-core/src/components/PortalHost/Connectable/ThrottleScheduler.ts index e6a77df6..c128a967 100644 --- a/packages/juno-core/src/components/PortalHost/Connectable/ThrottleScheduler.ts +++ b/packages/juno-core/src/components/PortalHost/Connectable/ThrottleScheduler.ts @@ -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?.(); }); } @@ -19,10 +18,6 @@ export class ThrottleScheduler implements Scheduler { clear() { window.clearTimeout(this._timeoutID); - this._reset(); - } - - private _reset() { this._lastTask = null; this._timeoutID = undefined; } diff --git a/sync-github.json b/sync-github.json index 7b08d6f8..d0080ebd 100644 --- a/sync-github.json +++ b/sync-github.json @@ -1,3 +1,3 @@ { - "latestCommitSHA": "b05e574c28e1879fb1190997f13848ed30042c11" + "latestCommitSHA": "2b2ac1d04488fab2bba55871f0474357d04d4064" } \ No newline at end of file