File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,23 +51,17 @@ export class Credentials {
5151 return c ;
5252 }
5353
54- private async createOctokit (
55- createIfNone : boolean ,
56- ) : Promise < Octokit . Octokit | undefined > {
54+ private async createOctokit ( ) : Promise < Octokit . Octokit > {
5755 const session = await vscode . authentication . getSession (
5856 GITHUB_AUTH_PROVIDER_ID ,
5957 SCOPES ,
60- { createIfNone } ,
58+ { createIfNone : true } ,
6159 ) ;
6260
63- if ( session ) {
64- return new Octokit . Octokit ( {
65- auth : session . accessToken ,
66- retry,
67- } ) ;
68- } else {
69- return undefined ;
70- }
61+ return new Octokit . Octokit ( {
62+ auth : session . accessToken ,
63+ retry,
64+ } ) ;
7165 }
7266
7367 registerListeners ( context : vscode . ExtensionContext ) : void {
@@ -87,14 +81,8 @@ export class Credentials {
8781 * @returns An instance of Octokit.
8882 */
8983 async getOctokit ( ) : Promise < Octokit . Octokit > {
90- if ( this . octokit ) {
91- return this . octokit ;
92- }
93-
94- this . octokit = await this . createOctokit ( true ) ;
95-
9684 if ( ! this . octokit ) {
97- throw new Error ( "Did not initialize Octokit." ) ;
85+ this . octokit = await this . createOctokit ( ) ;
9886 }
9987 return this . octokit ;
10088 }
You can’t perform that action at this time.
0 commit comments