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

Commitedb505c

Browse files
committed
Clean up
1 parentdf63df6 commitedb505c

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

‎src/commands.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,11 @@ export class Commands {
197197
// It is possible that we are trying to log into an old-style host, in which
198198
// case we want to write with the provided blank label instead of generating
199199
// a host label.
200-
constlabel=args?.label===undefined ?toSafeHost(url) :args?.label;
200+
constlabel=args?.label===undefined ?toSafeHost(url) :args.label;
201201

202202
// Try to get a token from the user, if we need one, and their user.
203-
constres=awaitthis.maybeAskToken(
204-
url,
205-
args?.token,
206-
args?.autoLogin===true,
207-
);
203+
constautoLogin=args?.autoLogin===true;
204+
constres=awaitthis.maybeAskToken(url,args?.token,autoLogin);
208205
if(!res){
209206
return;// The user aborted, or unable to auth.
210207
}

‎src/remote/remote.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export class Remote {
5959
privatereadonlypathResolver:PathResolver;
6060
privatereadonlycliManager:CliManager;
6161

62+
// Used to race between the login dialog and the logging in from a different window
6263
privateloginDetectedResolver:(()=>void)|undefined;
6364
privateloginDetectedPromise:Promise<void>=Promise.resolve();
6465

@@ -75,7 +76,6 @@ export class Remote {
7576

7677
/**
7778
* Creates a new promise that will be resolved when login is detected in another window.
78-
* This should be called when starting a setup operation that might need login.
7979
*/
8080
privatecreateLoginDetectionPromise():void{
8181
this.loginDetectedPromise=newPromise<void>((resolve)=>{
@@ -85,7 +85,6 @@ export class Remote {
8585

8686
/**
8787
* Resolves the current login detection promise if one exists.
88-
* This should be called from the extension when login is detected.
8988
*/
9089
publicresolveLoginDetected():void{
9190
if(this.loginDetectedResolver){
@@ -257,14 +256,13 @@ export class Remote {
257256
// Migrate "session_token" file to "session", if needed.
258257
awaitthis.migrateSessionToken(parts.label);
259258

260-
// Try to detect any login event that might happen after we read the current configs
261-
this.createLoginDetectionPromise();
262259
// Get the URL and token belonging to this host.
263260
const{url:baseUrlRaw, token}=awaitthis.cliManager.readConfig(
264261
parts.label,
265262
);
266263

267264
constshowLoginDialog=async(message:string)=>{
265+
this.createLoginDetectionPromise();
268266
constdialogPromise=this.vscodeProposed.window.showInformationMessage(
269267
message,
270268
{
@@ -370,8 +368,6 @@ export class Remote {
370368
// Next is to find the workspace from the URI scheme provided.
371369
letworkspace:Workspace;
372370
try{
373-
// We could've logged out in the meantime
374-
this.createLoginDetectionPromise();
375371
this.logger.info(`Looking for workspace${workspaceName}...`);
376372
workspace=awaitworkspaceClient.getWorkspaceByOwnerAndName(
377373
parts.username,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp