Skip to content

Commit 4f700c2

Browse files
committed
fix crash on first open
1 parent b69fc19 commit 4f700c2

23 files changed

+54
-9
lines changed

pkg/gui/gui.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,6 @@ func (gui *Gui) Run() error {
515515
return err
516516
}
517517

518-
if !gui.Config.GetUserConfig().DisableStartupPopups {
519-
popupTasks := []func(chan struct{}) error{}
520-
storedPopupVersion := gui.Config.GetAppState().StartupPopupVersion
521-
if storedPopupVersion < StartupPopupVersion {
522-
popupTasks = append(popupTasks, gui.showIntroPopupMessage)
523-
}
524-
gui.showInitialPopups(popupTasks)
525-
}
526-
527518
gui.waitForIntro.Add(1)
528519
if gui.Config.GetUserConfig().Git.AutoFetch {
529520
go utils.Safe(gui.startBackgroundFetch)

pkg/gui/layout.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,15 @@ func (gui *Gui) onInitialViewsCreation() error {
375375
return err
376376
}
377377

378+
if !gui.Config.GetUserConfig().DisableStartupPopups {
379+
popupTasks := []func(chan struct{}) error{}
380+
storedPopupVersion := gui.Config.GetAppState().StartupPopupVersion
381+
if storedPopupVersion < StartupPopupVersion {
382+
popupTasks = append(popupTasks, gui.showIntroPopupMessage)
383+
}
384+
gui.showInitialPopups(popupTasks)
385+
}
386+
378387
if gui.showRecentRepos {
379388
if err := gui.handleCreateRecentReposMenu(); err != nil {
380389
return err

test/integration/initialOpen/config/config.yml

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
asd

test/integration/initialOpen/expected/.git_keep/FETCH_HEAD

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ref: refs/heads/master
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[core]
2+
repositoryformatversion = 0
3+
filemode = true
4+
bare = false
5+
logallrefupdates = true
6+
ignorecase = true
7+
precomposeunicode = true
8+
[user]
9+
10+
name = CI
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Unnamed repository; edit this file 'description' to name the repository.
209 Bytes
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# git ls-files --others --exclude-from=.git/info/exclude
2+
# Lines that start with '#' are comments.
3+
# For a project mostly in C, the following would be a good set of
4+
# exclude patterns (uncomment them if you want to use them):
5+
# *.[oa]
6+
# *~
7+
.DS_Store

0 commit comments

Comments
 (0)