File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
src/vs/workbench/contrib/chat/browser/actions Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -334,8 +334,6 @@ class AttachContextAction extends Action2 {
334
334
return ;
335
335
}
336
336
337
- const imageData = await clipboardService . readImage ( ) ;
338
-
339
337
const usedAgent = widget . parsedInput . parts . find ( p => p instanceof ChatRequestAgentPart ) ;
340
338
const slowSupported = usedAgent ? usedAgent . agent . metadata . supportsSlowVariables : true ;
341
339
const quickPickItems : ( IChatContextQuickPickItem | QuickPickItem ) [ ] = [ ] ;
@@ -351,13 +349,16 @@ class AttachContextAction extends Action2 {
351
349
}
352
350
}
353
351
354
- if ( isImage ( imageData ) && configurationService . getValue < boolean > ( 'chat.experimental.imageAttachments' ) ) {
355
- quickPickItems . push ( {
356
- id : await imageToHash ( imageData ) ,
357
- kind : 'image' ,
358
- label : localize ( 'imageFromClipboard' , 'Image from Clipboard' ) ,
359
- iconClass : ThemeIcon . asClassName ( Codicon . fileMedia ) ,
360
- } ) ;
352
+ if ( configurationService . getValue < boolean > ( 'chat.experimental.imageAttachments' ) ) {
353
+ const imageData = await clipboardService . readImage ( ) ;
354
+ if ( isImage ( imageData ) ) {
355
+ quickPickItems . push ( {
356
+ id : await imageToHash ( imageData ) ,
357
+ kind : 'image' ,
358
+ label : localize ( 'imageFromClipboard' , 'Image from Clipboard' ) ,
359
+ iconClass : ThemeIcon . asClassName ( Codicon . fileMedia ) ,
360
+ } ) ;
361
+ }
361
362
}
362
363
363
364
if ( widget . viewModel ?. sessionId ) {
You can’t perform that action at this time.
0 commit comments