diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 5d3c427df..2fbda51fc 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -1213,12 +1213,13 @@ def changedetection_app(config=None, datastore_o=None): flash("{} watches are queued for rechecking.".format(i)) return redirect(url_for('index', tag=tag)) - @app.route("/toggle-theme", methods=['GET']) + @app.route("/toggle-darkmode-state", methods=['GET']) @login_required - def toggle_theme(): + def toggle_darkmode_state(): current_mode = datastore.data['settings']['application'].get('css_dark_mode') new_mode = not current_mode datastore.data['settings']['application']['css_dark_mode'] = new_mode + datastore.needs_write = True return '' @app.route("/form/checkbox-operations", methods=['POST']) diff --git a/changedetectionio/static/js/toggle-theme.js b/changedetectionio/static/js/toggle-theme.js index c9f73e858..5e0189c38 100644 --- a/changedetectionio/static/js/toggle-theme.js +++ b/changedetectionio/static/js/toggle-theme.js @@ -3,7 +3,7 @@ * Toggles theme between light and dark mode. */ $(document).ready(function () { - const url = "/toggle-theme"; + const url = "/toggle-darkmode-state"; const button = document.getElementsByClassName("toggle-theme")[0];