aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-07-02 02:56:50 +0100
committerVeetaha <[email protected]>2020-07-02 03:05:29 +0100
commit69b6f6def525d33a60a3a992960d1085403d3b60 (patch)
tree03cba7d6874862d386b4bbc5502fa607a53715b9 /editors/code/src
parent8035b0a27ebfa4a64fbb55eada1df63ac3e54835 (diff)
Always install required nightly extension if current one is not nightly
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/main.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 5ceab8b44..1ad75a03c 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -152,13 +152,17 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
152 return; 152 return;
153 }; 153 };
154 154
155 const lastCheck = state.lastCheck;
156 const now = Date.now(); 155 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;
157 160
158 const anHour = 60 * 60 * 1000; 161 const anHour = 60 * 60 * 1000;
159 const shouldDownloadNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour; 162 const shouldCheckForNewNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour;
160 163
161 if (!shouldDownloadNightly) return; 164 if (!shouldCheckForNewNightly) return;
165 }
162 166
163 const release = await fetchRelease("nightly").catch((e) => { 167 const release = await fetchRelease("nightly").catch((e) => {
164 log.error(e); 168 log.error(e);