@@ -2,7 +2,7 @@ import { Disposable, Webview, WebviewPanel, window, Uri, ViewColumn, ExtensionCo
2
2
import { getUri } from "./utilities/getUri" ;
3
3
import { getNonce } from "./utilities/getNonce" ;
4
4
import { ARDUINO_ERRORS , ARDUINO_MESSAGES , ArduinoProjectStatus , WebviewToExtensionMessage } from './shared/messages' ;
5
- import { arduinoCLI , arduinoExtensionChannel , arduinoProject , changeTheme , loadArduinoConfiguration , openExample , updateStateCompileUpload } from "./extension" ;
5
+ import { arduinoCLI , arduinoExtensionChannel , arduinoProject , changeTheme , loadArduinoConfiguration , openExample , shouldDetectPorts , updateStateCompileUpload } from "./extension" ;
6
6
import { ARDUINO_SKETCH_EXTENSION } from "./ArduinoProject" ;
7
7
8
8
const path = require ( 'path' ) ;
@@ -14,7 +14,9 @@ export class VueWebviewPanel {
14
14
private _disposables : Disposable [ ] = [ ] ;
15
15
public static currentPanel : VueWebviewPanel | undefined ;
16
16
private usbChange ( ) {
17
- VueWebviewPanel . sendMessage ( { command : ARDUINO_MESSAGES . REQUEST_BOARD_CONNECTED , errorMessage : "" , payload : "" } ) ;
17
+ if ( shouldDetectPorts ( ) ) {
18
+ VueWebviewPanel . sendMessage ( { command : ARDUINO_MESSAGES . REQUEST_BOARD_CONNECTED , errorMessage : "" , payload : "" } ) ;
19
+ }
18
20
}
19
21
private constructor ( panel : WebviewPanel , extensionUri : Uri ) {
20
22
this . _panel = panel ;
0 commit comments