Skip to content

Commit

Permalink
Move update to top of function
Browse files Browse the repository at this point in the history
Now they will even be updated when it hasn't changed yet
  • Loading branch information
l0drex committed Nov 9, 2022
1 parent 2d02f66 commit b3aa202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/yin_yang.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def should_be_dark(time_current: time, time_light: time, time_dark: time) -> boo
def set_mode(dark: bool, force=False):
"""Activates light or dark theme"""

update_times()
if not force and dark == config.dark_mode:
return

Expand All @@ -45,7 +46,6 @@ def set_mode(dark: bool, force=False):
except Exception as e:
logger.error('Error while changing theme in ' + p.name, exc_info=e)

update_times()
config.dark_mode = dark


Expand Down

0 comments on commit b3aa202

Please sign in to comment.