From 5ad3e02ed1787f0ba7024143e655454f6a377cf7 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 6 Dec 2022 23:31:00 +0100 Subject: [PATCH] accept none --- changedetectionio/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 65cd60345..81a4a3afd 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -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.