diff options
author | Matthias Einwag <[email protected]> | 2020-09-23 09:03:34 +0100 |
---|---|---|
committer | Matthias Einwag <[email protected]> | 2020-09-23 09:03:34 +0100 |
commit | 145bd6f70138246b4e5efebcd94786f147ac9e7a (patch) | |
tree | 120e380da28da851bc4ad632a009b4d14ccc1b65 /editors | |
parent | 501b516db4a9a50c39e2fb90b389d77c9541e43f (diff) |
Fix clearing the token
The previous version would have interpreted an empty token as
an abort of the dialog and would have not properly cleared the token.
This is now fixed by checking for `undefined` for a an abort and
by setting the token to `undefined` in order to clear it.
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/src/main.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 2fcd853d4..ce7c56d05 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -393,8 +393,13 @@ async function queryForGithubToken(state: PersistentState): Promise<void> { | |||
393 | }; | 393 | }; |
394 | 394 | ||
395 | const newToken = await vscode.window.showInputBox(githubTokenOptions); | 395 | const newToken = await vscode.window.showInputBox(githubTokenOptions); |
396 | if (newToken) { | 396 | if (newToken !== undefined) { |
397 | log.info("Storing new github token"); | 397 | if (newToken === "") { |
398 | await state.updateGithubToken(newToken); | 398 | log.info("Clearing github token"); |
399 | await state.updateGithubToken(undefined); | ||
400 | } else { | ||
401 | log.info("Storing new github token"); | ||
402 | await state.updateGithubToken(newToken); | ||
403 | } | ||
399 | } | 404 | } |
400 | } | 405 | } |