summaryrefslogtreecommitdiff
path: root/lua/main.lua
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-09-09 15:15:00 +1000
committerjacqueline <me@jacqueline.id.au>2024-09-09 15:15:00 +1000
commit2b1a01705d62d08cefd6816ba108c5cae48a50ac (patch)
tree20ba16a6259ffc335dbcded84fa6bcbe327e9d84 /lua/main.lua
parent9475d10d1000c7e21a7ea311b0c8ee6a72ef46c4 (diff)
parentacdc9789c90ed6f083d054cd07930e020123457f (diff)
downloadtangara-fw-2b1a01705d62d08cefd6816ba108c5cae48a50ac.tar.gz
Merge branch 'main' into jqln/tts
Diffstat (limited to 'lua/main.lua')
-rw-r--r--lua/main.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/lua/main.lua b/lua/main.lua
index 4cd754b6..f79b0e87 100644
--- a/lua/main.lua
+++ b/lua/main.lua
@@ -14,9 +14,15 @@ local backstack = require("backstack")
local main_menu = require("main_menu")
local function init_ui()
- -- Load the theme within init_ui because the theme needs fonts to be ready.
- local theme_dark = require("theme_dark")
- theme.set(theme_dark)
+ -- Theme is set within init_ui because the theme needs fonts to be ready.
+ -- Set the theme to the saved theme if available
+ local saved_theme = theme.theme_filename()
+ local res = theme.load_theme(saved_theme)
+ if not res then
+ -- Set a default theme (in case the saved theme does not load)
+ local default_theme = require("theme_light")
+ theme.set(default_theme)
+ end
local lock_time = time.ticks()
@@ -59,7 +65,7 @@ local function init_ui()
elseif time.ticks() - lock_time > 8000 then
local queue = require("queue")
if queue.size:get() > 0 then
- require("playing"):pushIfNotShown()
+ require("playing"):push_if_not_shown()
end
end
end),