mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Extract a SaveAppStateAndLogError function
It seems that most actions that change a state option and resave the state want to just log the error.
This commit is contained in:
parent
1dac4158e9
commit
1106981827
4 changed files with 9 additions and 6 deletions
|
@ -92,6 +92,12 @@ func (self *guiCommon) SaveAppState() error {
|
|||
return self.gui.Config.SaveAppState()
|
||||
}
|
||||
|
||||
func (self *guiCommon) SaveAppStateAndLogError() {
|
||||
if err := self.gui.Config.SaveAppState(); err != nil {
|
||||
self.gui.Log.Errorf("error when saving app state: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func (self *guiCommon) GetConfig() config.AppConfigurer {
|
||||
return self.gui.Config
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue