Skip to content

Commit

Permalink
Apply changes to run() better
Browse files Browse the repository at this point in the history
  • Loading branch information
cormacrelf committed Sep 17, 2020
1 parent e3f3bbb commit 447e51d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lua/dark_notify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ function run(config)
conf.schemes = schemes
end)

if not get_config().initialized then
local config = get_config()
if not config.initialized then
-- first run on startup, also happens to apply current mode
init_dark_notify()
else
apply_current_mode()
elseif config.current_mode ~= nil then
-- we have run it before, but we're updating the settings
-- so don't reset to system, but do apply changed config.
local mode = config.current_mode
apply_mode(mode)
end
end

Expand Down

0 comments on commit 447e51d

Please sign in to comment.