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 Nov 15, 2020
1 parent 82156a5 commit 9399312
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 9399312

Please sign in to comment.