@@ -810,10 +810,10 @@ index 096b9e23493539c9937940a56e555d95bbae38d9..ef37e614004f550f7b64eacd362f6894
810
810
remove(key: string, scope: StorageScope): void {
811
811
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
812
812
new file mode 100644
813
- index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152ed407146
813
+ index 0000000000000000000000000000000000000000..8a92b722b38f8743403892ea97cfb2a2a8726e3b
814
814
--- /dev/null
815
815
+++ b/src/vs/server/browser/client.ts
816
- @@ -0,0 +1,240 @@
816
+ @@ -0,0 +1,241 @@
817
817
+ import { Emitter } from 'vs/base/common/event';
818
818
+ import { URI } from 'vs/base/common/uri';
819
819
+ import { localize } from 'vs/nls';
@@ -967,8 +967,7 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
967
967
+
968
968
+ const logService = (services.get(ILogService) as ILogService);
969
969
+ const storageService = (services.get(IStorageService) as IStorageService);
970
- + // We set this here first in case the path changes.
971
- + const updateCheckEndpoint = path.join(window.location.pathname, '/update/check');
970
+ + const updateCheckEndpoint = path.join(options.base, '/update/check');
972
971
+ const getUpdate = async (): Promise<void> => {
973
972
+ logService.debug('Checking for update...');
974
973
+
@@ -988,8 +987,8 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
988
987
+
989
988
+ const lastNoti = storageService.getNumber('csLastUpdateNotification', StorageScope.GLOBAL);
990
989
+ if (lastNoti) {
991
- + // Only remind them again after two days .
992
- + const timeout = 1000*60*24*2 ;
990
+ + // Only remind them again after 1 week .
991
+ + const timeout = 1000*60*60* 24*7 ;
993
992
+ const threshold = lastNoti + timeout;
994
993
+ if (Date.now() < threshold) {
995
994
+ return;
@@ -1008,11 +1007,13 @@ index 0000000000000000000000000000000000000000..ead6a3cd5e98fdde074f19ee5043f152
1008
1007
+ logService.debug(`failed to check for update: ${error}`);
1009
1008
+ }).finally(() => {
1010
1009
+ // Check again every 6 hours.
1011
- + setTimeout(updateLoop, 1000*60*6);
1010
+ + setTimeout(updateLoop, 1000*60*60* 6);
1012
1011
+ });
1013
1012
+ };
1014
1013
+
1015
- + updateLoop();
1014
+ + if (!options.disableUpdateCheck) {
1015
+ + updateLoop();
1016
+ + }
1016
1017
+
1017
1018
+ // This will be used to set the background color while VS Code loads.
1018
1019
+ const theme = storageService.get('colorThemeData', StorageScope.GLOBAL);
@@ -1446,16 +1447,18 @@ index 0000000000000000000000000000000000000000..56331ff1fc32bbd82e769aaecb551e42
1446
1447
+ require('../../bootstrap-amd').load('vs/server/entry');
1447
1448
diff --git a/src/vs/server/ipc.d.ts b/src/vs/server/ipc.d.ts
1448
1449
new file mode 100644
1449
- index 0000000000000000000000000000000000000000..0a4a91e5e36bda7f888feedda348aaff5fe32d27
1450
+ index 0000000000000000000000000000000000000000..c8a613ac2db1ff154a49aa7b6da5f7d2af902ec7
1450
1451
--- /dev/null
1451
1452
+++ b/src/vs/server/ipc.d.ts
1452
- @@ -0,0 +1,131 @@
1453
+ @@ -0,0 +1,133 @@
1453
1454
+ /**
1454
1455
+ * External interfaces for integration into code-server over IPC. No vs imports
1455
1456
+ * should be made in this file.
1456
1457
+ */
1457
1458
+ export interface Options {
1459
+ + base: string
1458
1460
+ disableTelemetry: boolean
1461
+ + disableUpdateCheck: boolean
1459
1462
+ }
1460
1463
+
1461
1464
+ export interface InitMessage {
0 commit comments