Skip to content

Commit 9b1fda3

Browse files
committed
chore: make icon green only when function returns true
1 parent 274224d commit 9b1fda3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/background.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ async function sendUrl (url, domain, tabId) {
1919
password: 'vue-telemetry-protected-area'
2020
}
2121
}).then(({ data }) => {
22+
browser.browserAction.setIcon({
23+
tabId,
24+
path: 'icons/icon-128.png'
25+
})
2226
setMapData(domain, data.body)
2327
}).catch((e) => {
2428
browser.browserAction.setIcon({
@@ -67,13 +71,6 @@ async function detectVue (tabId, url) {
6771
await hasVue(tabId).then(({ response }) => {
6872
store.commit('SET_CURRENTDOMAIN', response.vueInfo.domain)
6973

70-
if (response.vueInfo.hasVue) {
71-
browser.browserAction.setIcon({
72-
tabId,
73-
path: 'icons/icon-128.png'
74-
})
75-
}
76-
7774
if (!domainsVisited.includes(response.vueInfo.domain)) {
7875
domainsVisited.push(response.vueInfo.domain)
7976

0 commit comments

Comments
 (0)