diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index ed26c887b..a1521a93b 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -96,7 +96,7 @@ async function tryActivate(context: vscode.ExtensionContext) { | |||
96 | }); | 96 | }); |
97 | 97 | ||
98 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); | 98 | ctx.registerCommand('analyzerStatus', commands.analyzerStatus); |
99 | ctx.registerCommand('collectGarbage', commands.collectGarbage); | 99 | ctx.registerCommand('reloadWorkspace', commands.reloadWorkspace); |
100 | ctx.registerCommand('matchingBrace', commands.matchingBrace); | 100 | ctx.registerCommand('matchingBrace', commands.matchingBrace); |
101 | ctx.registerCommand('joinLines', commands.joinLines); | 101 | ctx.registerCommand('joinLines', commands.joinLines); |
102 | ctx.registerCommand('parentModule', commands.parentModule); | 102 | ctx.registerCommand('parentModule', commands.parentModule); |
@@ -160,13 +160,17 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi | |||
160 | return; | 160 | return; |
161 | }; | 161 | }; |
162 | 162 | ||
163 | const lastCheck = state.lastCheck; | ||
164 | const now = Date.now(); | 163 | const now = Date.now(); |
164 | if (config.package.releaseTag === NIGHTLY_TAG) { | ||
165 | // Check if we should poll github api for the new nightly version | ||
166 | // if we haven't done it during the past hour | ||
167 | const lastCheck = state.lastCheck; | ||
165 | 168 | ||
166 | const anHour = 60 * 60 * 1000; | 169 | const anHour = 60 * 60 * 1000; |
167 | const shouldDownloadNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour; | 170 | const shouldCheckForNewNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour; |
168 | 171 | ||
169 | if (!shouldDownloadNightly) return; | 172 | if (!shouldCheckForNewNightly) return; |
173 | } | ||
170 | 174 | ||
171 | const release = await fetchRelease("nightly").catch((e) => { | 175 | const release = await fetchRelease("nightly").catch((e) => { |
172 | log.error(e); | 176 | log.error(e); |