summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui_common.go
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-08-28 13:18:58 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-09-04 17:50:49 +0200
commit1106981827f5730ae9e71ff38bde27751fc66213 (patch)
treeb0a12c4412706d428351ab7245726d66f7005649 /pkg/gui/gui_common.go
parent1dac4158e9d8c8ab60203c76e9f86af409724823 (diff)
Extract a SaveAppStateAndLogError function
It seems that most actions that change a state option and resave the state want to just log the error.
Diffstat (limited to 'pkg/gui/gui_common.go')
-rw-r--r--pkg/gui/gui_common.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/gui/gui_common.go b/pkg/gui/gui_common.go
index e3e288c11..bad0957ec 100644
--- a/pkg/gui/gui_common.go
+++ b/pkg/gui/gui_common.go
@@ -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
}