saving an empty array if all accounts are selected for improved efficiency. see #327
This commit is contained in:
parent
ce3d392628
commit
93d30b6a02
1 changed files with 5 additions and 1 deletions
|
|
@ -145,8 +145,12 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
|
||||
document.querySelectorAll('.accountCheckbox').forEach(checkbox => {
|
||||
checkbox.addEventListener('change', () => {
|
||||
let selectedAccounts = Array.from(document.querySelectorAll('.accountCheckbox:checked')).map(checkbox => checkbox.value);
|
||||
let selectedAccounts = Array.from(document.querySelectorAll('.accountCheckbox:checked')).map(checkbox => checkbox.value);
|
||||
if (selectedAccounts.length === document.querySelectorAll('.accountCheckbox').length) {
|
||||
browser.storage.sync.set({ add_tags_enabled_accounts: [] });
|
||||
} else {
|
||||
browser.storage.sync.set({ add_tags_enabled_accounts: selectedAccounts });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue