Skip to content

Commit

Permalink
Fix local settings checkbox not staying checked when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
SeinopSys committed Sep 12, 2020
1 parent 6905f95 commit 45d60b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down

0 comments on commit 45d60b6

Please sign in to comment.