diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-02-23 23:01:45 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-02-24 02:45:05 -0800 |
commit | 043cb2ea44c9cf899b692e98ff39f1c86e15cb49 (patch) | |
tree | db34b8a67abb2ac07e3bf5cb0353d9e1ede56052 /pkg/config/app_config.go | |
parent | a62d70fbd57dafb1c9a657a7a51706f573835796 (diff) |
reload config whenever returning to gui
Diffstat (limited to 'pkg/config/app_config.go')
-rw-r--r-- | pkg/config/app_config.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 86801781b..b6d668439 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -41,6 +41,7 @@ type AppConfigurer interface { SaveAppState() error SetIsNewRepo(bool) GetIsNewRepo() bool + ReloadUserConfig() error } // NewAppConfig makes a new app config @@ -203,6 +204,16 @@ func (c *AppConfig) GetUserConfigDir() string { return c.UserConfigDir } +func (c *AppConfig) ReloadUserConfig() error { + userConfig, err := loadUserConfigWithDefaults(c.UserConfigDir) + if err != nil { + return err + } + + c.UserConfig = userConfig + return nil +} + func configFilePath(filename string) (string, error) { folder, err := findOrCreateConfigDir() if err != nil { |