未验证 提交 def81245 编写于 作者: A Anmol Sethi

vscode: Check updates with absolute path

In case the window location path changes. Not entirely sure if it can
but best to be on the safe side.
上级 37c80c9b
......@@ -769,10 +769,10 @@ index 096b9e23493539c9937940a56e555d95bbae38d9..ef37e614004f550f7b64eacd362f6894
remove(key: string, scope: StorageScope): void {
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c6eef331346ebc244a26e8b1e5919d192225b971
index 0000000000000000000000000000000000000000..385b9da491d38a9f5d10fab6e4666c84a892f49d
--- /dev/null
+++ b/src/vs/server/browser/client.ts
@@ -0,0 +1,237 @@
@@ -0,0 +1,240 @@
+import { Emitter } from 'vs/base/common/event';
+import { URI } from 'vs/base/common/uri';
+import { localize } from 'vs/nls';
......@@ -792,6 +792,7 @@ index 0000000000000000000000000000000000000000..c6eef331346ebc244a26e8b1e5919d19
+import { Options } from 'vs/server/ipc.d';
+import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
+import { ILogService } from 'vs/platform/log/common/log';
+import * as path from 'vs/base/common/path';
+
+class TelemetryService extends TelemetryChannelClient {
+ public constructor(
......@@ -925,10 +926,12 @@ index 0000000000000000000000000000000000000000..c6eef331346ebc244a26e8b1e5919d19
+
+ const logService = (services.get(ILogService) as ILogService);
+ const storageService = (services.get(IStorageService) as IStorageService);
+ // We set this here first in case the path changes.
+ const updateCheckEndpoint = path.join(window.location.pathname, "/update/check")
+ const getUpdate = async (): Promise<void> => {
+ logService.debug("Checking for update...");
+
+ const response = await fetch("update/check", {
+ const response = await fetch(updateCheckEndpoint, {
+ headers: { "Accept": "application/json" },
+ });
+ if (!response.ok) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册