From 4178caa94a0e356165450bb2b1647a96f744ab42 Mon Sep 17 00:00:00 2001 From: s2 Date: Thu, 20 Jun 2019 15:51:56 +0200 Subject: [PATCH] show splash screen on startup if passed path is not a git repo --- app/js/index.js | 10 +++++++++- app/templates/firstRun.ejs | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 app/templates/firstRun.ejs diff --git a/app/js/index.js b/app/js/index.js index b80f7fba..b9141332 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -4,8 +4,11 @@ const electronFind = require('electron-find'); let findInPage = new electronFind.FindInPage(remote.getCurrentWebContents()); + let firstRun = true; + //events ipcRenderer.on('fileList', (event, files) => { + firstRun = false; if (files && files.length > 0) { ejs.preloadTemplate('templates/files.ejs') .then(t => { @@ -28,7 +31,12 @@ }); ipcRenderer.on('isNoGitLfsRepo', (event, repoDir) => { - $('.js-container').html(ejs.rr('templates/isNoGitLfsRepo.ejs', {repoDir: repoDir})); + if (firstRun) { + firstRun = false; + $('.js-container').html(ejs.rr('templates/firstRun.ejs', {repoDir: repoDir})); + } else { + $('.js-container').html(ejs.rr('templates/isNoGitLfsRepo.ejs', {repoDir: repoDir})); + } }); ipcRenderer.on('notification', (event, notification) => { diff --git a/app/templates/firstRun.ejs b/app/templates/firstRun.ejs new file mode 100644 index 00000000..9d83270b --- /dev/null +++ b/app/templates/firstRun.ejs @@ -0,0 +1,8 @@ +
+

gitlit

+

Handle git lfs locks with ease

+ +