accept none

This commit is contained in:
dgtlmoon
2022-12-06 23:31:00 +01:00
parent a114cb0d85
commit 5ad3e02ed1
+2 -2
View File
@@ -98,8 +98,8 @@ def init_app_secret(datastore_path):
@app.template_global()
def get_darkmode_state():
css_dark_mode = request.cookies.get('css_dark_mode')
return 'true' if strtobool(css_dark_mode) else 'false'
css_dark_mode = request.cookies.get('css_dark_mode', 'false')
return 'true' if css_dark_mode and strtobool(css_dark_mode) else 'false'
# We use the whole watch object from the store/JSON so we can see if there's some related status in terms of a thread
# running or something similar.