Skip to content

Commit

Permalink
Merge branch 'mintlify--x-gitlens' of https://github.com/mintlify/con…
Browse files Browse the repository at this point in the history
…nector into mintlify--x-gitlens
  • Loading branch information
handotdev committed Jul 15, 2022
2 parents 5eb6a89 + e089c68 commit 6257fa1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "mintlify",
"displayName": "Document Connector",
"description": "Create connections between documentation and code",
"version": "0.6.5",
"version": "0.6.7",
"icon": "assets/logo.png",
"repository": {
"url": "https://github.com/mintlify/connect"
Expand Down
1 change: 0 additions & 1 deletion vscode/src/mintlify-functionality/utils/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export const getGitData = async (fileFsPath: string, type: string, lines?: numbe
}
}
if (rawUri == null) {
await vscode.window.showWarningMessage(`No remote found on branch.`);
return;
}

Expand Down
9 changes: 6 additions & 3 deletions vscode/src/mintlify/webview/viewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export class ViewProvider implements WebviewViewProvider {
await vscode.window.showErrorMessage('User has insufficient credentials. Try again later');
return;
}

await this.authenticate(user);
const subdomain = query.get('subdomain');
await this.authenticate(user, subdomain);
} catch (err) {
await vscode.window.showErrorMessage('Error authenticating user');
}
Expand All @@ -133,8 +133,11 @@ export class ViewProvider implements WebviewViewProvider {
await this.container.storage.deleteSecret('subdomain');
}

public async authenticate(user: any) {
public async authenticate(user: any, subdomain?: string | null) {
await this.container.storage.storeSecret('userId', user.userId);
if (subdomain) {
await this.container.storage.storeSecret('subdomain', subdomain);
}
await vscode.commands.executeCommand('setContext', 'mintlify.isLoggedIn', true);
await vscode.window.showInformationMessage(`🙌 Successfully signed in with ${user.email}`);
await executeCommand(Commands.RefreshLinks);
Expand Down

0 comments on commit 6257fa1

Please sign in to comment.