don't refresh own tabs twice

fixes #336
This commit is contained in:
tophf 2018-01-29 04:37:24 +03:00
parent 4719088d39
commit ca5f8c941b
2 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,7 @@ global updateIcon
function run(tabs, msg, resolve) {
const {style, codeIsUpdated} = msg;
const {style, codeIsUpdated, refreshOwnTabs} = msg;
// the style was updated/saved so we need to remove the old copy of the original style
if (msg.method === 'styleUpdated' && msg.reason !== 'editPreview') {
@ -80,6 +80,7 @@ global updateIcon
const last = tabs[tabs.length - 1];
for (const tab of tabs) {
if (FIREFOX && !tab.width) continue;
if (refreshOwnTabs === false && tab.url.startsWith(URLS.ownOrigin)) continue;
chrome.webNavigation.getAllFrames({tabId: tab.id}, frames =>
refreshFrame(tab, frames, msg, tab === last && resolve));
}

View File

@ -202,6 +202,7 @@ function notifyAllTabs(msg) {
}
// propagate saved style state/code efficiently
if (styleUpdated) {
msg.refreshOwnTabs = false;
API.refreshAllTabs(msg);
}
}