Skip to content

Commit

Permalink
chore:correcting github login , correcting the signout feature, corre…
Browse files Browse the repository at this point in the history
…cting additional_prompts

Signed-off-by: Aditya-eddy <[email protected]>
  • Loading branch information
Aditya-eddy committed Oct 16, 2024
1 parent 834a501 commit 7f4568f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/SidebarProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,22 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
console.log('Navigate to ' + value);
let sveltePageJs: vscode.Uri;
let sveltePageCss: vscode.Uri;
if(value = "KeployChatBot"){
if(value == "KeployChatBot"){

Check warning on line 81 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Expected '===' and instead saw '=='

Check warning on line 81 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Expected '===' and instead saw '=='

Check warning on line 81 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Expected '===' and instead saw '=='
sveltePageJs = webviewView.webview.asWebviewUri(
vscode.Uri.joinPath(this._extensionUri, "out", "compiled", "KeployChat.js")
);
sveltePageCss = webviewView.webview.asWebviewUri(
vscode.Uri.joinPath(this._extensionUri, "out", "compiled", "KeployChat.css")
);
}
else if (value === 'Config') {

sveltePageJs = webviewView.webview.asWebviewUri(
vscode.Uri.joinPath(this._extensionUri, "out", "compiled", "Config.js")
);
sveltePageCss = webviewView.webview.asWebviewUri(
vscode.Uri.joinPath(this._extensionUri, "out", "compiled", "Config.css")
);

}
else {
Expand Down
13 changes: 13 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ export function activate(context: vscode.ExtensionContext) {
console.log({ emailID, isValid, error, JwtToken });

await context.globalState.update('JwtToken', JwtToken);
await context.globalState.update('SignedOthers', true);

// if (isValid) {
vscode.window.showInformationMessage('You are now signed in!');
Expand Down Expand Up @@ -640,6 +641,8 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showInformationMessage('You have been signed out.');
vscode.commands.executeCommand('setContext', 'keploy.signedIn', false);
vscode.commands.executeCommand('setContext', 'keploy.signedOut', true);
sidebarProvider.postMessage("Config");

});

context.subscriptions.push(signout);
Expand Down Expand Up @@ -713,6 +716,16 @@ export function activate(context: vscode.ExtensionContext) {
functionName = FunctionName;
ExtentionName = FileExtentionName;
FunctionFilePath = filePath;
const signedIn = await context.globalState.get('accessToken');
const signedInOthers = await context.globalState.get('SignedOthers');
const SubscriptionEnded = await context.globalState.get('SubscriptionEnded') !== undefined ? context.globalState.get('SubscriptionEnded') : true;
const token = await context.globalState.get<'string'>('JwtToken');
console.log("SubscriptionEnded Value: ", SubscriptionEnded);
if (!signedIn && !signedInOthers) {
// Redirect to the website if signed in
await vscode.commands.executeCommand('keploy.SignInWithOthers');
return;
}
vscode.commands.executeCommand('workbench.view.extension.Keploy-Sidebar');
sidebarProvider.postMessage("KeployChatBot")

Check warning on line 730 in src/extension.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Missing semicolon

Check warning on line 730 in src/extension.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Missing semicolon

Check warning on line 730 in src/extension.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Missing semicolon
});
Expand Down

0 comments on commit 7f4568f

Please sign in to comment.