Skip to content

Commit

Permalink
Reload window when a new session is created
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
  • Loading branch information
RomanNikitenko committed Sep 12, 2023
1 parent 9afdc82 commit 52c26a7
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class DeviceAuthentication {
await this.updateToken(token);
await this.gitHubAuthProvider.createSession([scopes]);

this.onNewSessionCreated(scopes, sessionsToRemove.length > 0);
this.onNewSessionCreated(scopes);
return token;
}

Expand Down Expand Up @@ -138,12 +138,7 @@ export class DeviceAuthentication {
};
}

private async onNewSessionCreated(scopes: string, isReloadRequired: boolean): Promise<void> {
if (!isReloadRequired) {
vscode.window.showInformationMessage(`A new session has been created for ${scopes} scopes.`);
return;
}

private async onNewSessionCreated(scopes: string): Promise<void> {
const message = `A new session has been created for ${scopes} scopes. Please reload window to apply it.`
const reloadNow = vscode.l10n.t('Reload Now');
const action = await vscode.window.showInformationMessage(message, reloadNow);
Expand Down

0 comments on commit 52c26a7

Please sign in to comment.