@@ -56,9 +56,11 @@ export function SelectionTools({ config, updateConfig }) {
5656 customSelectionTools [ editingIndex ] = editingTool
5757 await updateConfig ( { customSelectionTools } )
5858 }
59- Browser . runtime . sendMessage ( {
60- type : 'REFRESH_MENU' ,
61- } )
59+ Browser . runtime
60+ . sendMessage ( {
61+ type : 'REFRESH_MENU' ,
62+ } )
63+ . catch ( console . error )
6264 setEditing ( false )
6365 } }
6466 >
@@ -111,9 +113,11 @@ export function SelectionTools({ config, updateConfig }) {
111113 const activeSelectionTools = config . activeSelectionTools . filter ( ( i ) => i !== key )
112114 if ( checked ) activeSelectionTools . push ( key )
113115 await updateConfig ( { activeSelectionTools } )
114- Browser . runtime . sendMessage ( {
115- type : 'REFRESH_MENU' ,
116- } )
116+ Browser . runtime
117+ . sendMessage ( {
118+ type : 'REFRESH_MENU' ,
119+ } )
120+ . catch ( console . error )
117121 } }
118122 />
119123 { t ( toolsConfig [ key ] . label ) }
@@ -133,9 +137,11 @@ export function SelectionTools({ config, updateConfig }) {
133137 const customSelectionTools = [ ...config . customSelectionTools ]
134138 customSelectionTools [ index ] = { ...tool , active : e . target . checked }
135139 await updateConfig ( { customSelectionTools } )
136- Browser . runtime . sendMessage ( {
137- type : 'REFRESH_MENU' ,
138- } )
140+ Browser . runtime
141+ . sendMessage ( {
142+ type : 'REFRESH_MENU' ,
143+ } )
144+ . catch ( console . error )
139145 } }
140146 />
141147 { tool . name }
@@ -160,9 +166,11 @@ export function SelectionTools({ config, updateConfig }) {
160166 const customSelectionTools = [ ...config . customSelectionTools ]
161167 customSelectionTools . splice ( index , 1 )
162168 await updateConfig ( { customSelectionTools } )
163- Browser . runtime . sendMessage ( {
164- type : 'REFRESH_MENU' ,
165- } )
169+ Browser . runtime
170+ . sendMessage ( {
171+ type : 'REFRESH_MENU' ,
172+ } )
173+ . catch ( console . error )
166174 } }
167175 >
168176 < TrashIcon />
0 commit comments