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:
Stefan Haller 2023-08-28 13:18:58 +02:00
parent 1dac4158e9
commit 1106981827
4 changed files with 9 additions and 6 deletions

View file

@ -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
}