Skip to content

Commit

Permalink
minor code changes for backward compat
Browse files Browse the repository at this point in the history
  • Loading branch information
beebeeoii committed Jan 21, 2022
1 parent aa0c273 commit 71887d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion FyneApp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Website = "https://github.com/beebeeoii/lominus"
Name = "Lominus"
ID = "com.beebeeoii.lominus"
Version = "1.2.0"
Build = 116
Build = 120
24 changes: 19 additions & 5 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ func Init() error {
os.Mkdir(baseDir, os.ModePerm)
}

logInitErr := logs.Init()
if logInitErr != nil {
return logInitErr
}

preferencesPath, getPreferencesPathErr := appPref.GetPreferencesPath()
if getPreferencesPathErr != nil {
return getPreferencesPathErr
Expand All @@ -45,6 +40,25 @@ func Init() error {
if savePrefErr != nil {
return savePrefErr
}
} else {
preferences, getPreferencesErr := appPref.LoadPreferences(preferencesPath)
if getPreferencesErr != nil {
return getPreferencesErr
}

if preferences.LogLevel != "info" && preferences.LogLevel != "debug" {
preferences.LogLevel = "info"
}

savePrefErr := appPref.SavePreferences(preferencesPath, preferences)
if savePrefErr != nil {
return savePrefErr
}
}

logInitErr := logs.Init()
if logInitErr != nil {
return logInitErr
}

return nil
Expand Down

0 comments on commit 71887d1

Please sign in to comment.