Skip to content

Commit dd97d85

Browse files
author
Akos Kitta
committed
fix: a save as triggered from the sketch rename must delete the source sketch
partial revert of bec6e92 Signed-off-by: Akos Kitta <[email protected]>
1 parent bec6e92 commit dd97d85

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

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

+2-12
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,7 @@ export class SaveAsSketch extends CloudSketchContribution {
7474
if (cloudUri) {
7575
destinationUri = await this.createCloudCopy({ cloudUri, sketch });
7676
} else {
77-
const isTemp = await this.sketchesService.isTemp(sketch);
78-
if (!isTemp) {
79-
// If the current sketch is an ordinary non-temp sketch, do not delete it after the rename.
80-
// https://github.com/arduino/arduino-ide/issues/1882#issuecomment-1427524645
81-
wipeOriginal = false;
82-
}
83-
destinationUri = await this.createLocalCopy(
84-
sketch,
85-
isTemp,
86-
execOnlyIfTemp
87-
);
77+
destinationUri = await this.createLocalCopy(sketch, execOnlyIfTemp);
8878
}
8979
if (!destinationUri) {
9080
return false;
@@ -129,9 +119,9 @@ export class SaveAsSketch extends CloudSketchContribution {
129119

130120
private async createLocalCopy(
131121
sketch: Sketch,
132-
isTemp?: boolean,
133122
execOnlyIfTemp?: boolean
134123
): Promise<string | undefined> {
124+
const isTemp = await this.sketchesService.isTemp(sketch);
135125
if (!isTemp && !!execOnlyIfTemp) {
136126
return undefined;
137127
}

0 commit comments

Comments
 (0)