diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-02-16 13:29:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-16 13:29:24 +0100 |
commit | 5b567f37745ae82799d9460525935d83c0d97492 (patch) | |
tree | cb8446828d78752bd6211ed9b1bbf569fb464cc2 /pkg/gui/controllers | |
parent | b01bad7fad62ec54616d9cb9f0958da1d65c7aac (diff) | |
parent | 7f4a05debf58908ed706ca4659a6591fd9a08245 (diff) |
Migrate git.log.showGraph and git.log.order to app state (#3197)
Diffstat (limited to 'pkg/gui/controllers')
-rw-r--r-- | pkg/gui/controllers/local_commits_controller.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/gui/controllers/local_commits_controller.go b/pkg/gui/controllers/local_commits_controller.go index 3fadbe9e9..68a0ea742 100644 --- a/pkg/gui/controllers/local_commits_controller.go +++ b/pkg/gui/controllers/local_commits_controller.go @@ -928,8 +928,12 @@ func (self *LocalCommitsController) handleOpenLogMenu() error { OnPress: func() error { onPress := func(value string) func() error { return func() error { - self.c.UserConfig.Git.Log.ShowGraph = value - return nil + self.c.GetAppState().GitLogShowGraph = value + self.c.SaveAppStateAndLogError() + if err := self.c.PostRefreshUpdate(self.c.Contexts().LocalCommits); err != nil { + return err + } + return self.c.PostRefreshUpdate(self.c.Contexts().SubCommits) } } return self.c.Menu(types.CreateMenuOptions{ @@ -957,7 +961,8 @@ func (self *LocalCommitsController) handleOpenLogMenu() error { OnPress: func() error { onPress := func(value string) func() error { return func() error { - self.c.UserConfig.Git.Log.Order = value + self.c.GetAppState().GitLogOrder = value + self.c.SaveAppStateAndLogError() return self.c.WithWaitingStatus(self.c.Tr.LoadingCommits, func(gocui.Task) error { return self.c.Refresh( types.RefreshOptions{ |