Skip to content

Commit cf3445a

Browse files
committed
doublecheck internal status before verify/upload a sketch
1 parent 8858415 commit cf3445a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: arduino-ide-extension/src/browser/contributions/upload-sketch.ts

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ export class UploadSketch extends SketchContribution {
7676

7777
async uploadSketch(usingProgrammer: boolean = false): Promise<void> {
7878

79+
// even with buttons disabled, better to double check if an upload is already in progress
80+
if (this.uploadInProgress) {
81+
return;
82+
}
83+
7984
// toggle the toolbar button and menu item state.
8085
// uploadInProgress will be set to false whether the upload fails or not
8186
this.uploadInProgress = true;

Diff for: arduino-ide-extension/src/browser/contributions/verify-sketch.ts

+5
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ export class VerifySketch extends SketchContribution {
7272

7373
async verifySketch(exportBinaries?: boolean): Promise<void> {
7474

75+
// even with buttons disabled, better to double check if a verify is already in progress
76+
if (this.verifyInProgress) {
77+
return;
78+
}
79+
7580
// toggle the toolbar button and menu item state.
7681
// verifyInProgress will be set to false whether the compilation fails or not
7782
this.verifyInProgress = true;

0 commit comments

Comments
 (0)