Skip to content

Commit

Permalink
chore: open git panel when user opens a git project for the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Jan 19, 2025
1 parent c97e19a commit 2f75194
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/extensions/default/Git/src/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

define(function (require, exports) {

const _ = brackets.getModule("thirdparty/lodash"),
const _ = brackets.getModule("thirdparty/lodash"),
StateManager = brackets.getModule("preferences/StateManager"),
CodeInspection = brackets.getModule("language/CodeInspection"),
CommandManager = brackets.getModule("command/CommandManager"),
Commands = brackets.getModule("command/Commands"),
Expand Down Expand Up @@ -40,7 +41,8 @@ define(function (require, exports) {
gitDiffDialogTemplate = require("text!templates/git-diff-dialog.html"),
questionDialogTemplate = require("text!templates/git-question-dialog.html");

var showFileWhiteList = /^\.gitignore$/;
const showFileWhiteList = /^\.gitignore$/,
GIT_PANEL_SHOWN_ON_FIRST_BOOT = "GIT_PANEL_SHOWN_ON_FIRST_BOOT";

const COMMIT_MODE = {
CURRENT: "CURRENT",
Expand Down Expand Up @@ -1381,6 +1383,10 @@ define(function (require, exports) {
});

EventEmitter.on(Events.GIT_ENABLED, function () {
if(!StateManager.get(GIT_PANEL_SHOWN_ON_FIRST_BOOT)){
StateManager.set(GIT_PANEL_SHOWN_ON_FIRST_BOOT, true);
toggle(true);
}
// Add info from Git to panel
Git.getConfig("user.name").then(function (currentUserName) {
EventEmitter.emit(Events.GIT_USERNAME_CHANGED, currentUserName);
Expand Down

0 comments on commit 2f75194

Please sign in to comment.