cleanup callback name and enfore db update

This commit is contained in:
dgtlmoon
2022-12-04 14:55:16 +01:00
parent 5219698b07
commit 3b2b1ea2f7
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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'])
+1 -1
View File
@@ -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];