Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitac10af8

Browse files
committed
Get config once
A tiny refactor since I will need to get a third config option.
1 parent8beb761 commitac10af8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

‎src/storage.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,11 @@ export class Storage {
123123
* downloads being disabled.
124124
*/
125125
publicasyncfetchBinary(restClient:Api,label:string):Promise<string>{
126-
constbaseUrl=restClient.getAxiosInstance().defaults.baseURL;
126+
constcfg=vscode.workspace.getConfiguration("coder");
127127

128128
// Settings can be undefined when set to their defaults (true in this case),
129129
// so explicitly check against false.
130-
constenableDownloads=
131-
vscode.workspace.getConfiguration().get("coder.enableDownloads")!==
132-
false;
130+
constenableDownloads=cfg.get("enableDownloads")!==false;
133131
this.output.info("Downloads are",enableDownloads ?"enabled" :"disabled");
134132

135133
// Get the build info to compare with the existing binary version, if any,
@@ -189,9 +187,7 @@ export class Storage {
189187

190188
// Figure out where to get the binary.
191189
constbinName=cli.name();
192-
constconfigSource=vscode.workspace
193-
.getConfiguration()
194-
.get("coder.binarySource");
190+
constconfigSource=cfg.get("binarySource");
195191
constbinSource=
196192
configSource&&String(configSource).trim().length>0
197193
?String(configSource)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp