mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
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.
This commit is contained in:
parent
501b516db4
commit
145bd6f701
1 changed files with 8 additions and 3 deletions
|
@ -393,8 +393,13 @@ async function queryForGithubToken(state: PersistentState): Promise<void> {
|
|||
};
|
||||
|
||||
const newToken = await vscode.window.showInputBox(githubTokenOptions);
|
||||
if (newToken) {
|
||||
log.info("Storing new github token");
|
||||
await state.updateGithubToken(newToken);
|
||||
if (newToken !== undefined) {
|
||||
if (newToken === "") {
|
||||
log.info("Clearing github token");
|
||||
await state.updateGithubToken(undefined);
|
||||
} else {
|
||||
log.info("Storing new github token");
|
||||
await state.updateGithubToken(newToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue