From 5872779faa5abf857b24320a3c505a1936aec5a9 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 30 Jul 2024 14:40:26 +0200 Subject: [PATCH] Make gui.statusPanelView config hot-reloadable It still doesn't update the view immediately when reloading the config, only the next time the status panel is focused. But at least it does it then; writing the code to update the panel when reloading the config is probably not justifiable. --- pkg/gui/controllers/status_controller.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/gui/controllers/status_controller.go b/pkg/gui/controllers/status_controller.go index 3008f08c0..05b3181c1 100644 --- a/pkg/gui/controllers/status_controller.go +++ b/pkg/gui/controllers/status_controller.go @@ -89,15 +89,15 @@ func (self *StatusController) onClickMain(opts gocui.ViewMouseBindingOpts) error } func (self *StatusController) GetOnRenderToMain() func() error { - config := self.c.UserConfig().Gui - - switch config.StatusPanelView { - case "dashboard": - return self.showDashboard - case "allBranchesLog": - return self.showAllBranchLogs - default: - return self.showDashboard + return func() error { + switch self.c.UserConfig().Gui.StatusPanelView { + case "dashboard": + return self.showDashboard() + case "allBranchesLog": + return self.showAllBranchLogs() + default: + return self.showDashboard() + } } }