]> git.lizzy.rs Git - rust.git/commitdiff
Remove nightly release id from local storage for stable extensions
authorKirill Bulatov <mail4score@gmail.com>
Sun, 23 May 2021 08:49:34 +0000 (11:49 +0300)
committerKirill Bulatov <mail4score@gmail.com>
Sun, 23 May 2021 08:49:34 +0000 (11:49 +0300)
editors/code/src/main.ts
editors/code/src/persistent_state.ts

index ee2c50dc706e5bbf1d0b770f8502a63d56d84f39..5db66df93d1c29801342c8af7f89f55a5dc544cc 100644 (file)
@@ -156,9 +156,11 @@ export async function deactivate() {
 async function bootstrap(config: Config, state: PersistentState): Promise<string> {
     await fs.mkdir(config.globalStoragePath, { recursive: true });
 
+    if (config.package.releaseTag != NIGHTLY_TAG) {
+        await state.removeReleaseId();
+    }
     await bootstrapExtension(config, state);
     const path = await bootstrapServer(config, state);
-
     return path;
 }
 
index afb6525899170a22889d59ad049cef8efee857f9..2519bd77ab76ef2b888f63a57b922752e64bb9e1 100644 (file)
@@ -27,6 +27,9 @@ export class PersistentState {
     async updateReleaseId(value: number) {
         await this.globalState.update("releaseId", value);
     }
+    async removeReleaseId() {
+        await this.globalState.update("releaseId", undefined);
+    }
 
     /**
      * Version of the extension that installed the server.