Compare commits

..

2 Commits

Author SHA1 Message Date
ebd217dcc2
sharedconfig: actually return from load()
because who needs return values for a function dedicated specifically to
returning a value, amirite?
2023-06-24 23:30:48 -04:00
e07bd176ed
sharedstate: use queue/commit instead of set 2023-06-24 23:30:34 -04:00

View File

@ -18,7 +18,7 @@ local function add_default_value(key, value)
sharedstate.init(key, value)
if stored_value ~= nil then
sharedstate.set(key, stored_value)
sharedstate.queue(key, stored_value)
end
end
@ -30,6 +30,7 @@ function sharedconfig.load_defaults(defaults)
for k, v in pairs(defaults) do
add_default_value(k, v)
end
sharedstate.commit()
end
local function build_table()
@ -50,6 +51,8 @@ function sharedconfig.load(key)
end
-- defaults haven't been initialized yet
if defaults_table == nil then return nil end
return sharedstate.get(key)
end
--- Save config