File tree Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -15,24 +15,26 @@ browser.runtime.onMessage.addListener(
15
15
16
16
if ( ! tabsStorage [ sender . tab . id ] ) {
17
17
tabsStorage [ sender . tab . id ] = message . payload
18
- if ( message . payload . hasVue ) {
19
- try {
20
- const res = await fetch ( `https://vuetelemetry.com/api/analyze?url=${ message . payload . url } ` , {
21
- method : 'GET'
22
- } )
23
- . then ( ( response ) => {
24
- if ( ! response . ok ) {
25
- throw new Error ( 'API call to VT failed' )
26
- }
27
- return response . json ( )
28
- } )
29
- tabsStorage [ sender . tab . id ] . isPublic = res . body . isPublic
30
- tabsStorage [ sender . tab . id ] . slug = res . body . slug
31
- } catch ( err ) { }
32
- }
33
18
} else {
34
19
tabsStorage [ sender . tab . id ] = { ...tabsStorage [ sender . tab . id ] , ...message . payload }
35
20
}
21
+
22
+ const showcase = tabsStorage [ sender . tab . id ]
23
+ if ( showcase . hasVue && ! showcase . slug ) {
24
+ try {
25
+ const res = await fetch ( `https://vuetelemetry.com/api/analyze?url=${ message . payload . url } ` , {
26
+ method : 'GET'
27
+ } )
28
+ . then ( ( response ) => {
29
+ if ( ! response . ok ) {
30
+ throw new Error ( 'API call to VT failed' )
31
+ }
32
+ return response . json ( )
33
+ } )
34
+ showcase . isPublic = res . body . isPublic
35
+ showcase . slug = res . body . slug
36
+ } catch ( err ) { }
37
+ }
36
38
// tabsStorage[sender.tab.id] = message.payload
37
39
} else if ( ! sender . tab ) {
38
40
if ( message . action === 'getShowcase' ) {
You can’t perform that action at this time.
0 commit comments