From 2f751944659bea84432bfaa5a2836cf1c891c9a2 Mon Sep 17 00:00:00 2001 From: abose Date: Sun, 19 Jan 2025 15:39:03 +0530 Subject: [PATCH] chore: open git panel when user opens a git project for the first time --- src/extensions/default/Git/src/Panel.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/extensions/default/Git/src/Panel.js b/src/extensions/default/Git/src/Panel.js index bc4f41a91..d62ddf156 100644 --- a/src/extensions/default/Git/src/Panel.js +++ b/src/extensions/default/Git/src/Panel.js @@ -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"), @@ -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", @@ -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);