Set default theme if not set

This commit is contained in:
Zed 2019-10-28 04:10:21 +01:00
parent 51a5c473ae
commit 08845922f4
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,8 @@ proc getPrefs*(id: string; cfg: Config): Prefs =
withDb:
try:
result.getOne("id = ?", id)
if result.theme.len == 0:
result.theme = cfg.defaultTheme
except KeyError:
result = getDefaultPrefs(cfg)