Debounce updateAllTabsIcon

This commit is contained in:
eight 2018-10-04 19:39:59 +08:00
parent dc5f3e209f
commit 81e4823f46

View File

@ -150,11 +150,7 @@ prefs.subscribe([
'badgeDisabled',
'badgeNormal',
'iconset',
], () =>
queryTabs().then(tabs =>
tabs.map(t => updateIcon({tab: t}))
)
);
], () => debounce(updateAllTabsIcon));
// *************************************************************************
chrome.runtime.onInstalled.addListener(({reason}) => {
@ -534,3 +530,9 @@ function onRuntimeMessage(msg, sender, sendResponse) {
respond(result);
}
}
function updateAllTabsIcon() {
return queryTabs().then(tabs =>
tabs.map(t => updateIcon({tab: t}))
);
}