File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
arduino-ide-extension/src/browser/contributions Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 88 CommandRegistry ,
99 MenuModelRegistry ,
1010 KeybindingRegistry ,
11+ Sketch ,
1112 URI ,
1213} from './contribution' ;
1314import { nls } from '@theia/core/lib/common' ;
@@ -47,12 +48,12 @@ export class Close extends SketchContribution {
4748 return {
4849 reason : 'temp-sketch' ,
4950 action : ( ) => {
50- return this . showTempSketchDialog ( ) ;
51+ return this . showSaveTempSketchDialog ( ) ;
5152 } ,
5253 } ;
5354 }
5455
55- private async showTempSketchDialog ( ) : Promise < boolean > {
56+ private async showSaveTempSketchDialog ( ) : Promise < boolean > {
5657 const sketch = await this . sketchServiceClient . currentSketch ( ) ;
5758 if ( ! CurrentSketch . isValid ( sketch ) ) {
5859 return true ;
@@ -61,6 +62,15 @@ export class Close extends SketchContribution {
6162 if ( ! isTemp ) {
6263 return true ;
6364 }
65+
66+ // If non of the sketch files were ever touched, do not prompt the save dialog. (#1274)
67+ const wereTouched = await Promise . all (
68+ Sketch . uris ( sketch ) . map ( ( uri ) => this . wasTouched ( uri ) )
69+ ) ;
70+ if ( wereTouched . every ( ( wasTouched ) => ! Boolean ( wasTouched ) ) ) {
71+ return true ;
72+ }
73+
6474 const messageBoxResult = await remote . dialog . showMessageBox (
6575 remote . getCurrentWindow ( ) ,
6676 {
You can’t perform that action at this time.
0 commit comments