Handle cancelled sign in when publishing to GitHub, fixes #96502
This commit is contained in:
parent
2e6d3bdf6c
commit
6eeaab8e5d
1 changed files with 11 additions and 3 deletions
|
@ -57,9 +57,17 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
|||
quickpick.show();
|
||||
quickpick.busy = true;
|
||||
|
||||
const octokit = await getOctokit();
|
||||
const user = await octokit.users.getAuthenticated({});
|
||||
const owner = user.data.login;
|
||||
let owner: string;
|
||||
try {
|
||||
const octokit = await getOctokit();
|
||||
const user = await octokit.users.getAuthenticated({});
|
||||
owner = user.data.login;
|
||||
} catch (e) {
|
||||
// User has cancelled sign in
|
||||
quickpick.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
quickpick.busy = false;
|
||||
|
||||
let repo: string | undefined;
|
||||
|
|
Loading…
Reference in a new issue