Skip to content

Commit

Permalink
Merge pull request #544 from yuiseo/main
Browse files Browse the repository at this point in the history
  • Loading branch information
yuiseo authored Jul 20, 2024
2 parents 387f840 + 8b6a948 commit d05dd61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import WebviewLoader from "./webview-loader";

let myStatusBarItem: vscode.StatusBarItem;
const projectName = 'githru';

function normalizeFsPath(fsPath: string) {
return fsPath.replace(/\\/g, "/");
Expand All @@ -33,10 +34,12 @@ export async function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "githru" is now active!');

const disposable = vscode.commands.registerCommand(COMMAND_LAUNCH, async () => {
myStatusBarItem.text = `$(sync~spin) ${projectName}`;
try {
console.debug("current Panel = ", currentPanel, currentPanel?.onDidDispose);
if (currentPanel) {
currentPanel.reveal();
myStatusBarItem.text = `$(check) ${projectName}`;
return;
}
const gitPath = (await findGit()).path;
Expand Down Expand Up @@ -100,12 +103,14 @@ export async function activate(context: vscode.ExtensionContext) {
currentPanel?.onDidDispose(
() => {
currentPanel = undefined;
myStatusBarItem.text = projectName;
},
null,
context.subscriptions
);

subscriptions.push(webLoader);
myStatusBarItem.text = `$(check) ${projectName}`;
vscode.window.showInformationMessage("Hello Githru");
} catch (error) {
if (error instanceof GithubTokenUndefinedError) {
Expand Down Expand Up @@ -137,7 +142,7 @@ export async function activate(context: vscode.ExtensionContext) {
subscriptions.concat([disposable, loginWithGithub, resetGithubAuth]);

myStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, -10);
myStatusBarItem.text = "githru";
myStatusBarItem.text = projectName;
myStatusBarItem.command = COMMAND_LAUNCH;
subscriptions.push(myStatusBarItem);

Expand Down

0 comments on commit d05dd61

Please sign in to comment.