File tree Expand file tree Collapse file tree 4 files changed +30
-17
lines changed
Expand file tree Collapse file tree 4 files changed +30
-17
lines changed Original file line number Diff line number Diff line change 22
33# Changelog
44
5+ ## 0.10.1
6+
7+ - Fixed the copy button for code blocks.
8+ - Improved error handling when fetching live rules.
9+
510## 0.10.0
611
712- Variables in code panels are now copyable.
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ const highlighted = computed(() => {
5454const code = computed (() => props .code )
5555const copy = useCopy (code )
5656
57+ function handleCopy() {
58+ copy ()
59+ }
60+
5761function handleClick(event : MouseEvent ) {
5862 const target = event .target as HTMLElement
5963 if (target .closest (' .token.copyable' )) {
@@ -68,7 +72,7 @@ function handleClick(event: MouseEvent) {
6872 {{ title }}
6973 <div class =" tp-row tp-gap" >
7074 <slot name =" actions" />
71- <IconButton variant =" secondary" title =" Copy" @click =" copy " >
75+ <IconButton variant =" secondary" title =" Copy" @click =" handleCopy " >
7276 <Copy />
7377 </IconButton >
7478 </div >
Original file line number Diff line number Diff line change @@ -5,24 +5,28 @@ const SYNC_ALARM = 'sync-rules'
55const SYNC_INTERVAL_MINUTES = 10
66
77async function fetchRules ( ) {
8- const res = await fetch ( RULE_URL , { cache : 'no-store' } )
9- if ( ! res . ok ) {
10- console . error ( '[tempad-dev] Failed to fetch rules:' , res . statusText )
11- }
12-
13- const newRules = await res . json ( )
14- const oldIds = ( await browser . declarativeNetRequest . getDynamicRules ( ) ) . map ( ( { id } ) => id )
8+ try {
9+ const res = await fetch ( RULE_URL , { cache : 'no-store' } )
10+ if ( ! res . ok ) {
11+ console . error ( '[tempad-dev] Failed to fetch rules:' , res . statusText )
12+ return
13+ }
1514
16- await browser . declarativeNetRequest . updateEnabledRulesets ( {
17- disableRulesetIds : [ 'figma' ]
18- } )
15+ const newRules = await res . json ( )
16+ const oldIds = ( await browser . declarativeNetRequest . getDynamicRules ( ) ) . map ( ( { id } ) => id )
1917
20- await browser . declarativeNetRequest . updateDynamicRules ( {
21- removeRuleIds : oldIds ,
22- addRules : newRules
23- } )
18+ await browser . declarativeNetRequest . updateEnabledRulesets ( {
19+ disableRulesetIds : [ 'figma' ]
20+ } )
2421
25- console . log ( `[tempad-dev] Updated ${ newRules . length } rule${ newRules . length === 1 ? '' : 's' } .` )
22+ await browser . declarativeNetRequest . updateDynamicRules ( {
23+ removeRuleIds : oldIds ,
24+ addRules : newRules
25+ } )
26+ console . log ( `[tempad-dev] Updated ${ newRules . length } rule${ newRules . length === 1 ? '' : 's' } .` )
27+ } catch ( error ) {
28+ console . error ( '[tempad-dev] Error fetching rules:' , error )
29+ }
2630}
2731
2832export default defineBackground ( ( ) => {
Original file line number Diff line number Diff line change 22 "name" : " tempad-dev" ,
33 "description" : " Inspect panel on Figma, for everyone." ,
44 "private" : true ,
5- "version" : " 0.10.0 " ,
5+ "version" : " 0.10.1 " ,
66 "type" : " module" ,
77 "scripts" : {
88 "dev" : " wxt" ,
You can’t perform that action at this time.
0 commit comments