mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-09-27 07:46:22 +00:00
cleanup callback name and enfore db update
This commit is contained in:
@@ -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'])
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user