From 98f575966b6109330fa0b610fa0e8c0f58bc7bbd Mon Sep 17 00:00:00 2001 From: rohan Date: Sun, 20 Jun 2021 21:29:16 +0530 Subject: [PATCH] remove infinite loop on settings page --- scripts/settings.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/settings.js b/scripts/settings.js index c4c80dc..a247473 100644 --- a/scripts/settings.js +++ b/scripts/settings.js @@ -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(); @@ -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;