Skip to content

Commit 07703e7

Browse files
committed
chore: open git panel when user opens a git project for the first time
1 parent c97e19a commit 07703e7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/extensions/default/Git/src/Panel.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
define(function (require, exports) {
44

5-
const _ = brackets.getModule("thirdparty/lodash"),
5+
const _ = brackets.getModule("thirdparty/lodash"),
6+
StateManager = brackets.getModule("preferences/StateManager"),
67
CodeInspection = brackets.getModule("language/CodeInspection"),
78
CommandManager = brackets.getModule("command/CommandManager"),
89
Commands = brackets.getModule("command/Commands"),
@@ -40,7 +41,8 @@ define(function (require, exports) {
4041
gitDiffDialogTemplate = require("text!templates/git-diff-dialog.html"),
4142
questionDialogTemplate = require("text!templates/git-question-dialog.html");
4243

43-
var showFileWhiteList = /^\.gitignore$/;
44+
const showFileWhiteList = /^\.gitignore$/,
45+
GIT_PANEL_SHOWN_ON_FIRST_BOOT = "GIT_PANEL_SHOWN_ON_FIRST_BOOT";
4446

4547
const COMMIT_MODE = {
4648
CURRENT: "CURRENT",
@@ -1381,6 +1383,10 @@ define(function (require, exports) {
13811383
});
13821384

13831385
EventEmitter.on(Events.GIT_ENABLED, function () {
1386+
if(!StateManager.get(GIT_PANEL_SHOWN_ON_FIRST_BOOT)){
1387+
StateManager.set(GIT_PANEL_SHOWN_ON_FIRST_BOOT, true);
1388+
toggle(true);
1389+
}
13841390
// Add info from Git to panel
13851391
Git.getConfig("user.name").then(function (currentUserName) {
13861392
EventEmitter.emit(Events.GIT_USERNAME_CHANGED, currentUserName);

0 commit comments

Comments
 (0)