From 657e752987f225a7feb29d282d75d994cff5f42e Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 23 Jan 2025 21:14:10 -0800 Subject: [PATCH] fix autoupdate --- .../contrib/void/browser/voidUpdateActions.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts b/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts index bd95e747..04b263b4 100644 --- a/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts +++ b/src/vs/workbench/contrib/void/browser/voidUpdateActions.ts @@ -79,18 +79,13 @@ class VoidUpdateWorkbenchContribution extends Disposable implements IWorkbenchCo } // check once 5 seconds after mount - this._register({ - dispose: () => clearTimeout( - setTimeout(() => autoCheck(), 5 * 1000) - ) - }) + + const initId = setTimeout(() => autoCheck(), 5 * 1000) + this._register({ dispose: () => clearTimeout(initId) }) // check every 3 hours - this._register({ - dispose: () => clearInterval( - setInterval(() => autoCheck(), 3 * 60 * 60 * 1000) - ) - }) + const intervalId = setInterval(() => autoCheck(), 3 * 60 * 60 * 1000) + this._register({ dispose: () => clearInterval(intervalId) }) } }