Skip to content

Commit b1ad596

Browse files
author
infiniteregrets
committed
.
1 parent 3d1c168 commit b1ad596

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

src/binaryManager.ts

+3-21
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async function getConfiguredMirrordBinary(): Promise<string | null> {
8282

8383
let latestVersion;
8484
try {
85-
latestVersion = await getLatestSupportedVersion(1000);
85+
latestVersion = await getLatestSupportedVersion();
8686
} catch (err) {
8787
new NotificationBuilder()
8888
.withMessage(`failed to check latest supported version of mirrord binary, binary specified in settings may be outdated: ${err}`)
@@ -112,15 +112,15 @@ async function getConfiguredMirrordBinary(): Promise<string | null> {
112112
* to mirrord binary auto-update will prompt the user to reload the window.
113113
* @returns Path to mirrord binary
114114
*/
115-
export async function getMirrordBinary(extensionActivate?: boolean): Promise<string> {
115+
export async function getMirrordBinary(): Promise<string> {
116116
const configured = await getConfiguredMirrordBinary();
117117

118118
if (configured) {
119119
vscode.window.showInformationMessage(`Using mirrord binary specified in settings: ${configured}`);
120120
return configured;
121121
}
122122

123-
let foundLocal = await getLocalMirrordBinary();
123+
let foundLocal = await getLocalMirrordBinary();
124124
const latestVersion = await getLatestSupportedVersion();
125125

126126
const autoUpdateConfigured = vscode.workspace.getConfiguration().get("mirrord.autoUpdate");
@@ -139,24 +139,6 @@ export async function getMirrordBinary(extensionActivate?: boolean): Promise<str
139139
return extensionPath;
140140
}
141141

142-
143-
// if extension is activating, then set a global state to what was read in the workspace settings
144-
if (extensionActivate) {
145-
globalContext.workspaceState.update('autoUpdate', autoUpdateConfigured);
146-
} else {
147-
// extension is active, check if auto-update setting has changed
148-
const autoUpdate = globalContext.workspaceState.get('autoUpdate');
149-
if (autoUpdate !== autoUpdateConfigured) {
150-
await new NotificationBuilder()
151-
.withMessage("mirrord binary auto-update setting has changed, please reload the window for the change to take effect.")
152-
.withGenericAction("Reload", async () => {
153-
await vscode.commands.executeCommand("workbench.action.reloadWindow");
154-
})
155-
.warning();
156-
return extensionPath;
157-
}
158-
}
159-
160142
if (typeof autoUpdateConfigured === 'string') {
161143
if (semver.valid(autoUpdateConfigured)) {
162144
const localMirrordBinary = await getLocalMirrordBinary(autoUpdateConfigured);

src/extension.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function activate(context: vscode.ExtensionContext) {
1414
vscode.debug.registerDebugConfigurationProvider('*', new ConfigurationProvider(), 2);
1515

1616
// start mirrord binary updates, so that we avoid downloading mid session
17-
await getMirrordBinary(true);
17+
await getMirrordBinary();
1818

1919
new MirrordStatus(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, 0))
2020
.register()

0 commit comments

Comments
 (0)