From 9399312e3ad770c12a1b08db2accf51d03337d42 Mon Sep 17 00:00:00 2001 From: SeinopSys Date: Mon, 31 Aug 2020 01:35:21 +0200 Subject: [PATCH] Fix local settings checkbox not staying checked when enabled --- assets/js/settings.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/js/settings.js b/assets/js/settings.js index 360228eea..7a6d195e0 100644 --- a/assets/js/settings.js +++ b/assets/js/settings.js @@ -15,8 +15,11 @@ export function setupSettings() { // Local settings localCheckboxes.forEach(checkbox => { + const storeKey = checkbox.id.replace('user_', ''); + checkbox.checked = store.get(storeKey); + checkbox.addEventListener('change', () => { - store.set(checkbox.id.replace('user_', ''), checkbox.checked); + store.set(storeKey, checkbox.checked); }); });