Skip to content

Commit

Permalink
Increase auto save setting delay
Browse files Browse the repository at this point in the history
  • Loading branch information
dthung1602 committed May 19, 2022
1 parent bb46893 commit e4d682b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (window.browser === undefined) {
console.debug("Storage is set to: ", window.__storage__);
return Promise.resolve(window.__storage__)
},
get(value) {
get() {
return Promise.resolve(window.__storage__)
}
}
Expand Down Expand Up @@ -114,13 +114,13 @@ const selectAction = (event) => {
document.getElementById("action").addEventListener("change", selectAction);

// Save options
const saveOptions = debounce((event) => {
const saveOptions = debounce(() => {
const cleanSpamText = document.getElementById("text").value;
const cleanSpamImage = document.getElementById("image").value;
const clearSpamInterval = parseInt(document.getElementById("check-interval").value);
const banDomains = serializeDomains(document.getElementById("ban-domain").value);
browser.storage.local.set({ cleanSpamText, cleanSpamImage, clearSpamInterval, banDomains }).catch(console.error);
}, 100);
}, 1000);
document.getElementById("image").addEventListener("input", saveOptions);
document.getElementById("text").addEventListener("input", saveOptions);
document.getElementById("check-interval").addEventListener("input", saveOptions);
Expand Down

0 comments on commit e4d682b

Please sign in to comment.