Skip to content

Commit 69b6f6d

Browse files
committed
Always install required nightly extension if current one is not nightly
1 parent 8035b0a commit 69b6f6d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

editors/code/src/main.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,17 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
152152
return;
153153
};
154154

155-
const lastCheck = state.lastCheck;
156155
const now = Date.now();
156+
if (config.package.releaseTag === NIGHTLY_TAG) {
157+
// Check if we should poll github api for the new nightly version
158+
// if we haven't done it during the past hour
159+
const lastCheck = state.lastCheck;
157160

158-
const anHour = 60 * 60 * 1000;
159-
const shouldDownloadNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour;
161+
const anHour = 60 * 60 * 1000;
162+
const shouldCheckForNewNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour;
160163

161-
if (!shouldDownloadNightly) return;
164+
if (!shouldCheckForNewNightly) return;
165+
}
162166

163167
const release = await fetchRelease("nightly").catch((e) => {
164168
log.error(e);

0 commit comments

Comments
 (0)