Skip to content

Commit

Permalink
remove infinite loop on settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanb10 committed Jun 20, 2021
1 parent 1d95bf6 commit 98f5759
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ async function initialize() {
if (options.icons) document.querySelector('.nap-room img').src = `../icons/${options.icons}/nap-room.png`;

try {updateFormValues(options)} catch(e) {}

chrome.storage.onChanged.addListener(async changes => {
if (changes.snoozedOptions && changes.snoozedOptions.newValue) updateFormValues(changes.snoozedOptions.newValue);
});

addListeners();
await fetchHourFormat();
Expand Down Expand Up @@ -98,6 +94,7 @@ function addListeners() {
}

async function save(e) {
e.stopPropagation();
if (e && e.target.id === 'history') {
var tabs = await getSnoozedTabs();
var count = tabs.filter(t => t.opened && dayjs().isAfter(dayjs(t.opened).add(e.target.value, 'd'))).length;
Expand Down

0 comments on commit 98f5759

Please sign in to comment.